﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Threading;
using System.Globalization;
using Nivdal.AuxCode;

namespace Nivdal
{
    public partial class MatchInstructionsStep2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = Resources.Resource.Default_PageTitle + ", " + Resources.Resource.MatchInstructionsStep2_PageTitle;
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                Response.Redirect("~/Default.aspx");
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
            OnlineUser ou = (OnlineUser)Session["User"];
            
            if (ou.TeamId == "Null")
                Response.Redirect("~/GeneralMessage.aspx?MessageString=M74ggdizz5wfeh");

            string MatchId = null;
            if (Request.QueryString["MatchId"] != null)
                MatchId = Request.QueryString["MatchId"].ToString();
            if (MatchId == null)
                Response.Redirect("GeneralMessage.aspx?MessageString=l43ZZOTLOB");

            MatchIdHiddenField.Value = MatchId;

            if (Request.QueryString["Formation"] != null)
                Formation.Value = Request.QueryString["Formation"].ToString();
            else
                Formation.Value = "load default";


            if (!GND.ReadNivdalBoolData("@UserId", "@MatchId", "Nivdal_ShouldUserGiveInstructionsToMatch", ou.UserId, MatchId))
            {
                Response.Redirect("GeneralMessage.aspx?MessageString=ko3ATUOTLOB");
            }

            if (!IsPostBack)
            {
                this.GetPlayersDDLSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
                this.MatchInstructionsSqlDataSource.SelectParameters.Add("UserId", ou.UserId);
                this.MatchInstructionsSqlDataSource.SelectParameters.Add("MatchId", MatchId);
                //this.GetPlayersDetailsForMatchInstructionsPageSQLDqtqSourse.SelectParameters.Add("TeamId", TeamId);
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("Language", ou.Language);
            }
            this.TopMessagePalnel.Visible = ((this.PlayersToSubmitErrorLabel.Text != "") || (this.Message.Text != ""));

            //ShowPlayerDetailsLinkButton.Text = Resources.Resource.MatchInstructionsStep2_ShowPlayerDetailsLinkButton;
            //HidePlayersLinkButton.Text = Resources.Resource.Global_HidePlayersDetails;
            //switch (PlayerDetailsPanel.Visible)
            //{
            //    case true:
            //        this.ShowPlayerDetailsLinkButton.Text = "Hide players details";
            //        break;
            //    case false:
            //        this.ShowPlayerDetailsLinkButton.Text = "Show players details";
            //        break;
            //}
            this.PenaltyTakersPanel.Visible = GND.ReadNivdalBoolData("@MatchId", "Nivdal_ShouldPenaltyTakersBeShown", MatchId);
            Language.Value = ou.Language;
            this.PageNameLabel.Text = GND.ReadNivdalStringData("@MatchId", "Nivdal_GetMatchTitleString", MatchId) + " " + Resources.Resource.MatchInstructionsStep2_RightPageNameLabel;
            //this.Title = this.PageNameLabel.Text + " - nivdal.com!";

        }

        protected void Page_PreRender(Object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                OnlineUser ou = (OnlineUser)Session["User"];
                string MatchId = null;
                MatchId = MatchIdHiddenField.Value;
                if (MatchId == null)
                    Response.Redirect("GeneralMessage.aspx?MessageString=l43ZZOTLOB");

                switch (Formation.Value)
                {
                    case "550":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "4";
                        PositionPlayer5.Value = "5";
                        PositionPlayer6.Value = "6";
                        PositionPlayer7.Value = "7";
                        PositionPlayer8.Value = "8";
                        PositionPlayer9.Value = "9";
                        PositionPlayer10.Value = "10";
                        PositionPlayer11.Value = "11";
                        SetDefaultSelectedValues();
                        break;
                    case "541":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "4";
                        PositionPlayer5.Value = "5";
                        PositionPlayer6.Value = "6";
                        PositionPlayer7.Value = "7";
                        PositionPlayer8.Value = "8";
                        PositionPlayer9.Value = "10";
                        PositionPlayer10.Value = "11";
                        PositionPlayer11.Value = "14";
                        SetDefaultSelectedValues();
                        break;
                    case "532":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "4";
                        PositionPlayer5.Value = "5";
                        PositionPlayer6.Value = "6";
                        PositionPlayer7.Value = "8";
                        PositionPlayer8.Value = "9";
                        PositionPlayer9.Value = "10";
                        PositionPlayer10.Value = "13";
                        PositionPlayer11.Value = "15";
                        SetDefaultSelectedValues();
                        break;
                    case "523":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "4";
                        PositionPlayer5.Value = "5";
                        PositionPlayer6.Value = "6";
                        PositionPlayer7.Value = "8";
                        PositionPlayer8.Value = "10";
                        PositionPlayer9.Value = "12";
                        PositionPlayer10.Value = "14";
                        PositionPlayer11.Value = "16";
                        SetDefaultSelectedValues();
                        break;
                    case "451":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "5";
                        PositionPlayer5.Value = "6";
                        PositionPlayer6.Value = "7";
                        PositionPlayer7.Value = "8";
                        PositionPlayer8.Value = "9";
                        PositionPlayer9.Value = "10";
                        PositionPlayer10.Value = "11";
                        PositionPlayer11.Value = "14";
                        SetDefaultSelectedValues();
                        break;
                    case "442":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "5";
                        PositionPlayer5.Value = "6";
                        PositionPlayer6.Value = "7";
                        PositionPlayer7.Value = "8";
                        PositionPlayer8.Value = "10";
                        PositionPlayer9.Value = "11";
                        PositionPlayer10.Value = "13";
                        PositionPlayer11.Value = "15";
                        SetDefaultSelectedValues();
                        break;
                    case "433":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "5";
                        PositionPlayer5.Value = "6";
                        PositionPlayer6.Value = "7";
                        PositionPlayer7.Value = "9";
                        PositionPlayer8.Value = "11";
                        PositionPlayer9.Value = "13";
                        PositionPlayer10.Value = "14";
                        PositionPlayer11.Value = "15";
                        SetDefaultSelectedValues();
                        break;
                    case "424":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "3";
                        PositionPlayer4.Value = "5";
                        PositionPlayer5.Value = "6";
                        PositionPlayer6.Value = "8";
                        PositionPlayer7.Value = "10";
                        PositionPlayer8.Value = "12";
                        PositionPlayer9.Value = "13";
                        PositionPlayer10.Value = "15";
                        PositionPlayer11.Value = "16";
                        SetDefaultSelectedValues();
                        break;
                    case "352":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "4";
                        PositionPlayer4.Value = "6";
                        PositionPlayer5.Value = "7";
                        PositionPlayer6.Value = "8";
                        PositionPlayer7.Value = "9";
                        PositionPlayer8.Value = "10";
                        PositionPlayer9.Value = "11";
                        PositionPlayer10.Value = "13";
                        PositionPlayer11.Value = "15";
                        SetDefaultSelectedValues();
                        break;
                    case "343":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "2";
                        PositionPlayer3.Value = "4";
                        PositionPlayer4.Value = "6";
                        PositionPlayer5.Value = "7";
                        PositionPlayer6.Value = "8";
                        PositionPlayer7.Value = "10";
                        PositionPlayer8.Value = "11";
                        PositionPlayer9.Value = "12";
                        PositionPlayer10.Value = "14";
                        PositionPlayer11.Value = "16";
                        SetDefaultSelectedValues();
                        break;
                    case "253":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "3";
                        PositionPlayer3.Value = "5";
                        PositionPlayer4.Value = "7";
                        PositionPlayer5.Value = "8";
                        PositionPlayer6.Value = "9";
                        PositionPlayer7.Value = "10";
                        PositionPlayer8.Value = "11";
                        PositionPlayer9.Value = "12";
                        PositionPlayer10.Value = "14";
                        PositionPlayer11.Value = "16";
                        SetDefaultSelectedValues();
                        break;
                    case "244":
                        PositionPlayer1.Value = "1";
                        PositionPlayer2.Value = "3";
                        PositionPlayer3.Value = "5";
                        PositionPlayer4.Value = "7";
                        PositionPlayer5.Value = "8";
                        PositionPlayer6.Value = "10";
                        PositionPlayer7.Value = "11";
                        PositionPlayer8.Value = "12";
                        PositionPlayer9.Value = "13";
                        PositionPlayer10.Value = "15";
                        PositionPlayer11.Value = "16";
                        SetDefaultSelectedValues();
                        break;
                    default:
                        SetDefaultDDLValues(ou.UserId, MatchId);
                        break;
                }

            }

        }
        protected void SetDefaultSelectedValues()
        {
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();

            Player1DropDownList.SelectedValue = "0";
            Player2DropDownList.SelectedValue = "0";
            Player3DropDownList.SelectedValue = "0";
            Player4DropDownList.SelectedValue = "0";
            Player5DropDownList.SelectedValue = "0";
            Player6DropDownList.SelectedValue = "0";
            Player7DropDownList.SelectedValue = "0";
            Player8DropDownList.SelectedValue = "0";
            Player9DropDownList.SelectedValue = "0";
            Player10DropDownList.SelectedValue = "0";
            Player11DropDownList.SelectedValue = "0";
            Player12DropDownList.SelectedValue = "0";
            Player13DropDownList.SelectedValue = "0";
            Player14DropDownList.SelectedValue = "0";
            Player15DropDownList.SelectedValue = "0";
            Player16DropDownList.SelectedValue = "0";
            Penalty1DropDownList.SelectedValue = "0";
            Penalty2DropDownList.SelectedValue = "0";
            Penalty3DropDownList.SelectedValue = "0";
            Penalty4DropDownList.SelectedValue = "0";
            Penalty5DropDownList.SelectedValue = "0";
            Penalty6DropDownList.SelectedValue = "0";
            Penalty7DropDownList.SelectedValue = "0";
            Penalty8DropDownList.SelectedValue = "0";
            Penalty9DropDownList.SelectedValue = "0";
            Penalty10DropDownList.SelectedValue = "0";
            Penalty11DropDownList.SelectedValue = "0";
            this.PositionLabel1.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer1.Value, Language.Value);
            this.PositionLabel2.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer2.Value, Language.Value);
            this.PositionLabel3.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer3.Value, Language.Value);
            this.PositionLabel4.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer4.Value, Language.Value);
            this.PositionLabel5.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer5.Value, Language.Value);
            this.PositionLabel6.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer6.Value, Language.Value);
            this.PositionLabel7.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer7.Value, Language.Value);
            this.PositionLabel8.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer8.Value, Language.Value);
            this.PositionLabel9.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer9.Value, Language.Value);
            this.PositionLabel10.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer10.Value, Language.Value);
            this.PositionLabel11.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer11.Value, Language.Value);
            Position12DropDownList.SelectedValue = "0";
            Position13DropDownList.SelectedValue = "0";
            Position14DropDownList.SelectedValue = "0";
            Position15DropDownList.SelectedValue = "0";
            Position16DropDownList.SelectedValue = "0";
            Instruction1DropDownList.SelectedValue = "2";
            Instruction2DropDownList.SelectedValue = "2";
            Instruction3DropDownList.SelectedValue = "2";
            Instruction4DropDownList.SelectedValue = "2";
            Instruction5DropDownList.SelectedValue = "2";
            Instruction6DropDownList.SelectedValue = "2";
            Instruction7DropDownList.SelectedValue = "2";
            Instruction8DropDownList.SelectedValue = "2";
            Instruction9DropDownList.SelectedValue = "2";
            Instruction10DropDownList.SelectedValue = "2";
            Instruction11DropDownList.SelectedValue = "2";
            PreferredAction1DropDownList.SelectedValue = "0";
            PreferredAction2DropDownList.SelectedValue = "0";
            PreferredAction3DropDownList.SelectedValue = "0";
            PreferredAction4DropDownList.SelectedValue = "0";
            PreferredAction5DropDownList.SelectedValue = "0";
            PreferredAction6DropDownList.SelectedValue = "0";
            PreferredAction7DropDownList.SelectedValue = "0";
            PreferredAction8DropDownList.SelectedValue = "0";
            PreferredAction9DropDownList.SelectedValue = "0";
            PreferredAction10DropDownList.SelectedValue = "0";
            PreferredAction11DropDownList.SelectedValue = "0";
            this.TeamAggressivenessDropDownList.SelectedValue = "2";
            this.TeamAttitudeDropDownList.SelectedValue = "3";
            this.CaptainDropDownList.SelectedValue = "0";
            this.PiecesTakerDropDownList.SelectedValue = "0";
        }
        
        protected void SetDefaultDDLValues(string UserId, string MatchId)
        {
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();


            string conn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(conn);
            System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();
            dbCommand.CommandText = "Nivdal_GetCurrentGameInstructionsOutput";
            dbCommand.CommandType = CommandType.StoredProcedure;
            dbCommand.Connection = dbConnection;

            SqlParameter dbParam_UserId = new SqlParameter();
            dbParam_UserId.ParameterName = "@UserId";
            dbParam_UserId.Value = UserId;
            dbParam_UserId.DbType = DbType.String;
            dbCommand.Parameters.Add(dbParam_UserId);

            SqlParameter dbParam_MatchId = new SqlParameter();
            dbParam_MatchId.ParameterName = "@MatchId";
            dbParam_MatchId.Value = MatchId;
            dbParam_MatchId.DbType = DbType.String;
            dbCommand.Parameters.Add(dbParam_MatchId);

            SqlParameter dbParam_PlayerId1 = new SqlParameter();
            dbParam_PlayerId1.ParameterName = "@PlayerId1";
            dbParam_PlayerId1.Value = "";
            dbParam_PlayerId1.DbType = DbType.Decimal;
            dbParam_PlayerId1.Direction = ParameterDirection.Output;
            dbParam_PlayerId1.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId1);

            SqlParameter dbParam_PlayerId2 = new SqlParameter();
            dbParam_PlayerId2.ParameterName = "@PlayerId2";
            dbParam_PlayerId2.Value = "";
            dbParam_PlayerId2.DbType = DbType.Decimal;
            dbParam_PlayerId2.Direction = ParameterDirection.Output;
            dbParam_PlayerId2.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId2);

            SqlParameter dbParam_PlayerId3 = new SqlParameter();
            dbParam_PlayerId3.ParameterName = "@PlayerId3";
            dbParam_PlayerId3.Value = "";
            dbParam_PlayerId3.DbType = DbType.Decimal;
            dbParam_PlayerId3.Direction = ParameterDirection.Output;
            dbParam_PlayerId3.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId3);

            SqlParameter dbParam_PlayerId4 = new SqlParameter();
            dbParam_PlayerId4.ParameterName = "@PlayerId4";
            dbParam_PlayerId4.Value = "";
            dbParam_PlayerId4.DbType = DbType.Decimal;
            dbParam_PlayerId4.Direction = ParameterDirection.Output;
            dbParam_PlayerId4.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId4);

            SqlParameter dbParam_PlayerId5 = new SqlParameter();
            dbParam_PlayerId5.ParameterName = "@PlayerId5";
            dbParam_PlayerId5.Value = "";
            dbParam_PlayerId5.DbType = DbType.Decimal;
            dbParam_PlayerId5.Direction = ParameterDirection.Output;
            dbParam_PlayerId5.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId5);

            SqlParameter dbParam_PlayerId6 = new SqlParameter();
            dbParam_PlayerId6.ParameterName = "@PlayerId6";
            dbParam_PlayerId6.Value = "";
            dbParam_PlayerId6.DbType = DbType.Decimal;
            dbParam_PlayerId6.Direction = ParameterDirection.Output;
            dbParam_PlayerId6.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId6);

            SqlParameter dbParam_PlayerId7 = new SqlParameter();
            dbParam_PlayerId7.ParameterName = "@PlayerId7";
            dbParam_PlayerId7.Value = "";
            dbParam_PlayerId7.DbType = DbType.Decimal;
            dbParam_PlayerId7.Direction = ParameterDirection.Output;
            dbParam_PlayerId7.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId7);

            SqlParameter dbParam_PlayerId8 = new SqlParameter();
            dbParam_PlayerId8.ParameterName = "@PlayerId8";
            dbParam_PlayerId8.Value = "";
            dbParam_PlayerId8.DbType = DbType.Decimal;
            dbParam_PlayerId8.Direction = ParameterDirection.Output;
            dbParam_PlayerId8.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId8);

            SqlParameter dbParam_PlayerId9 = new SqlParameter();
            dbParam_PlayerId9.ParameterName = "@PlayerId9";
            dbParam_PlayerId9.Value = "";
            dbParam_PlayerId9.DbType = DbType.Decimal;
            dbParam_PlayerId9.Direction = ParameterDirection.Output;
            dbParam_PlayerId9.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId9);

            SqlParameter dbParam_PlayerId10 = new SqlParameter();
            dbParam_PlayerId10.ParameterName = "@PlayerId10";
            dbParam_PlayerId10.Value = "";
            dbParam_PlayerId10.DbType = DbType.Decimal;
            dbParam_PlayerId10.Direction = ParameterDirection.Output;
            dbParam_PlayerId10.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId10);

            SqlParameter dbParam_PlayerId11 = new SqlParameter();
            dbParam_PlayerId11.ParameterName = "@PlayerId11";
            dbParam_PlayerId11.Value = "";
            dbParam_PlayerId11.DbType = DbType.Decimal;
            dbParam_PlayerId11.Direction = ParameterDirection.Output;
            dbParam_PlayerId11.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId11);

            SqlParameter dbParam_PlayerId12 = new SqlParameter();
            dbParam_PlayerId12.ParameterName = "@PlayerId12";
            dbParam_PlayerId12.Value = "";
            dbParam_PlayerId12.DbType = DbType.Decimal;
            dbParam_PlayerId12.Direction = ParameterDirection.Output;
            dbParam_PlayerId12.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId12);

            SqlParameter dbParam_PlayerId13 = new SqlParameter();
            dbParam_PlayerId13.ParameterName = "@PlayerId13";
            dbParam_PlayerId13.Value = "";
            dbParam_PlayerId13.DbType = DbType.Decimal;
            dbParam_PlayerId13.Direction = ParameterDirection.Output;
            dbParam_PlayerId13.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId13);

            SqlParameter dbParam_PlayerId14 = new SqlParameter();
            dbParam_PlayerId14.ParameterName = "@PlayerId14";
            dbParam_PlayerId14.Value = "";
            dbParam_PlayerId14.DbType = DbType.Decimal;
            dbParam_PlayerId14.Direction = ParameterDirection.Output;
            dbParam_PlayerId14.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId14);

            SqlParameter dbParam_PlayerId15 = new SqlParameter();
            dbParam_PlayerId15.ParameterName = "@PlayerId15";
            dbParam_PlayerId15.Value = "";
            dbParam_PlayerId15.DbType = DbType.Decimal;
            dbParam_PlayerId15.Direction = ParameterDirection.Output;
            dbParam_PlayerId15.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId15);

            SqlParameter dbParam_PlayerId16 = new SqlParameter();
            dbParam_PlayerId16.ParameterName = "@PlayerId16";
            dbParam_PlayerId16.Value = "";
            dbParam_PlayerId16.DbType = DbType.Decimal;
            dbParam_PlayerId16.Direction = ParameterDirection.Output;
            dbParam_PlayerId16.Size = 12;
            dbCommand.Parameters.Add(dbParam_PlayerId16);

            SqlParameter dbParam_PenaltyId1 = new SqlParameter();
            dbParam_PenaltyId1.ParameterName = "@Penalty1Taker";
            dbParam_PenaltyId1.Value = "";
            dbParam_PenaltyId1.DbType = DbType.Decimal;
            dbParam_PenaltyId1.Direction = ParameterDirection.Output;
            dbParam_PenaltyId1.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId1);

            SqlParameter dbParam_PenaltyId2 = new SqlParameter();
            dbParam_PenaltyId2.ParameterName = "@Penalty2Taker";
            dbParam_PenaltyId2.Value = "";
            dbParam_PenaltyId2.DbType = DbType.Decimal;
            dbParam_PenaltyId2.Direction = ParameterDirection.Output;
            dbParam_PenaltyId2.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId2);

            SqlParameter dbParam_PenaltyId3 = new SqlParameter();
            dbParam_PenaltyId3.ParameterName = "@Penalty3Taker";
            dbParam_PenaltyId3.Value = "";
            dbParam_PenaltyId3.DbType = DbType.Decimal;
            dbParam_PenaltyId3.Direction = ParameterDirection.Output;
            dbParam_PenaltyId3.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId3);

            SqlParameter dbParam_PenaltyId4 = new SqlParameter();
            dbParam_PenaltyId4.ParameterName = "@Penalty4Taker";
            dbParam_PenaltyId4.Value = "";
            dbParam_PenaltyId4.DbType = DbType.Decimal;
            dbParam_PenaltyId4.Direction = ParameterDirection.Output;
            dbParam_PenaltyId4.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId4);

            SqlParameter dbParam_PenaltyId5 = new SqlParameter();
            dbParam_PenaltyId5.ParameterName = "@Penalty5Taker";
            dbParam_PenaltyId5.Value = "";
            dbParam_PenaltyId5.DbType = DbType.Decimal;
            dbParam_PenaltyId5.Direction = ParameterDirection.Output;
            dbParam_PenaltyId5.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId5);

            SqlParameter dbParam_PenaltyId6 = new SqlParameter();
            dbParam_PenaltyId6.ParameterName = "@Penalty6Taker";
            dbParam_PenaltyId6.Value = "";
            dbParam_PenaltyId6.DbType = DbType.Decimal;
            dbParam_PenaltyId6.Direction = ParameterDirection.Output;
            dbParam_PenaltyId6.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId6);

            SqlParameter dbParam_PenaltyId7 = new SqlParameter();
            dbParam_PenaltyId7.ParameterName = "@Penalty7Taker";
            dbParam_PenaltyId7.Value = "";
            dbParam_PenaltyId7.DbType = DbType.Decimal;
            dbParam_PenaltyId7.Direction = ParameterDirection.Output;
            dbParam_PenaltyId7.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId7);

            SqlParameter dbParam_PenaltyId8 = new SqlParameter();
            dbParam_PenaltyId8.ParameterName = "@Penalty8Taker";
            dbParam_PenaltyId8.Value = "";
            dbParam_PenaltyId8.DbType = DbType.Decimal;
            dbParam_PenaltyId8.Direction = ParameterDirection.Output;
            dbParam_PenaltyId8.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId8);

            SqlParameter dbParam_PenaltyId9 = new SqlParameter();
            dbParam_PenaltyId9.ParameterName = "@Penalty9Taker";
            dbParam_PenaltyId9.Value = "";
            dbParam_PenaltyId9.DbType = DbType.Decimal;
            dbParam_PenaltyId9.Direction = ParameterDirection.Output;
            dbParam_PenaltyId9.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId9);

            SqlParameter dbParam_PenaltyId10 = new SqlParameter();
            dbParam_PenaltyId10.ParameterName = "@Penalty10Taker";
            dbParam_PenaltyId10.Value = "";
            dbParam_PenaltyId10.DbType = DbType.Decimal;
            dbParam_PenaltyId10.Direction = ParameterDirection.Output;
            dbParam_PenaltyId10.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId10);

            SqlParameter dbParam_PenaltyId11 = new SqlParameter();
            dbParam_PenaltyId11.ParameterName = "@Penalty11Taker";
            dbParam_PenaltyId11.Value = "";
            dbParam_PenaltyId11.DbType = DbType.Decimal;
            dbParam_PenaltyId11.Direction = ParameterDirection.Output;
            dbParam_PenaltyId11.Size = 12;
            dbCommand.Parameters.Add(dbParam_PenaltyId11);


            SqlParameter dbParam_PositionId1 = new SqlParameter();
            dbParam_PositionId1.ParameterName = "@PositionPlayer1";
            dbParam_PositionId1.Value = "";
            dbParam_PositionId1.DbType = DbType.Decimal;
            dbParam_PositionId1.Direction = ParameterDirection.Output;
            dbParam_PositionId1.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId1);

            SqlParameter dbParam_PositionId2 = new SqlParameter();
            dbParam_PositionId2.ParameterName = "@PositionPlayer2";
            dbParam_PositionId2.Value = "";
            dbParam_PositionId2.DbType = DbType.Decimal;
            dbParam_PositionId2.Direction = ParameterDirection.Output;
            dbParam_PositionId2.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId2);

            SqlParameter dbParam_PositionId3 = new SqlParameter();
            dbParam_PositionId3.ParameterName = "@PositionPlayer3";
            dbParam_PositionId3.Value = "";
            dbParam_PositionId3.DbType = DbType.Decimal;
            dbParam_PositionId3.Direction = ParameterDirection.Output;
            dbParam_PositionId3.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId3);

            SqlParameter dbParam_PositionId4 = new SqlParameter();
            dbParam_PositionId4.ParameterName = "@PositionPlayer4";
            dbParam_PositionId4.Value = "";
            dbParam_PositionId4.DbType = DbType.Decimal;
            dbParam_PositionId4.Direction = ParameterDirection.Output;
            dbParam_PositionId4.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId4);

            SqlParameter dbParam_PositionId5 = new SqlParameter();
            dbParam_PositionId5.ParameterName = "@PositionPlayer5";
            dbParam_PositionId5.Value = "";
            dbParam_PositionId5.DbType = DbType.Decimal;
            dbParam_PositionId5.Direction = ParameterDirection.Output;
            dbParam_PositionId5.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId5);

            SqlParameter dbParam_PositionId6 = new SqlParameter();
            dbParam_PositionId6.ParameterName = "@PositionPlayer6";
            dbParam_PositionId6.Value = "";
            dbParam_PositionId6.DbType = DbType.Decimal;
            dbParam_PositionId6.Direction = ParameterDirection.Output;
            dbParam_PositionId6.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId6);

            SqlParameter dbParam_PositionId7 = new SqlParameter();
            dbParam_PositionId7.ParameterName = "@PositionPlayer7";
            dbParam_PositionId7.Value = "";
            dbParam_PositionId7.DbType = DbType.Decimal;
            dbParam_PositionId7.Direction = ParameterDirection.Output;
            dbParam_PositionId7.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId7);

            SqlParameter dbParam_PositionId8 = new SqlParameter();
            dbParam_PositionId8.ParameterName = "@PositionPlayer8";
            dbParam_PositionId8.Value = "";
            dbParam_PositionId8.DbType = DbType.Decimal;
            dbParam_PositionId8.Direction = ParameterDirection.Output;
            dbParam_PositionId8.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId8);

            SqlParameter dbParam_PositionId9 = new SqlParameter();
            dbParam_PositionId9.ParameterName = "@PositionPlayer9";
            dbParam_PositionId9.Value = "";
            dbParam_PositionId9.DbType = DbType.Decimal;
            dbParam_PositionId9.Direction = ParameterDirection.Output;
            dbParam_PositionId9.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId9);

            SqlParameter dbParam_PositionId10 = new SqlParameter();
            dbParam_PositionId10.ParameterName = "@PositionPlayer10";
            dbParam_PositionId10.Value = "";
            dbParam_PositionId10.DbType = DbType.Decimal;
            dbParam_PositionId10.Direction = ParameterDirection.Output;
            dbParam_PositionId10.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId10);

            SqlParameter dbParam_PositionId11 = new SqlParameter();
            dbParam_PositionId11.ParameterName = "@PositionPlayer11";
            dbParam_PositionId11.Value = "";
            dbParam_PositionId11.DbType = DbType.Decimal;
            dbParam_PositionId11.Direction = ParameterDirection.Output;
            dbParam_PositionId11.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId11);

            SqlParameter dbParam_PositionId12 = new SqlParameter();
            dbParam_PositionId12.ParameterName = "@PositionPlayer12";
            dbParam_PositionId12.Value = "";
            dbParam_PositionId12.DbType = DbType.Decimal;
            dbParam_PositionId12.Direction = ParameterDirection.Output;
            dbParam_PositionId12.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId12);

            SqlParameter dbParam_PositionId13 = new SqlParameter();
            dbParam_PositionId13.ParameterName = "@PositionPlayer13";
            dbParam_PositionId13.Value = "";
            dbParam_PositionId13.DbType = DbType.Decimal;
            dbParam_PositionId13.Direction = ParameterDirection.Output;
            dbParam_PositionId13.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId13);

            SqlParameter dbParam_PositionId14 = new SqlParameter();
            dbParam_PositionId14.ParameterName = "@PositionPlayer14";
            dbParam_PositionId14.Value = "";
            dbParam_PositionId14.DbType = DbType.Decimal;
            dbParam_PositionId14.Direction = ParameterDirection.Output;
            dbParam_PositionId14.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId14);

            SqlParameter dbParam_PositionId15 = new SqlParameter();
            dbParam_PositionId15.ParameterName = "@PositionPlayer15";
            dbParam_PositionId15.Value = "";
            dbParam_PositionId15.DbType = DbType.Decimal;
            dbParam_PositionId15.Direction = ParameterDirection.Output;
            dbParam_PositionId15.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId15);

            SqlParameter dbParam_PositionId16 = new SqlParameter();
            dbParam_PositionId16.ParameterName = "@PositionPlayer16";
            dbParam_PositionId16.Value = "";
            dbParam_PositionId16.DbType = DbType.Decimal;
            dbParam_PositionId16.Direction = ParameterDirection.Output;
            dbParam_PositionId16.Size = 2;
            dbCommand.Parameters.Add(dbParam_PositionId16);

            SqlParameter dbParam_InstructionId1 = new SqlParameter();
            dbParam_InstructionId1.ParameterName = "@InstructionPlayer1";
            dbParam_InstructionId1.Value = "";
            dbParam_InstructionId1.DbType = DbType.Decimal;
            dbParam_InstructionId1.Direction = ParameterDirection.Output;
            dbParam_InstructionId1.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId1);

            SqlParameter dbParam_InstructionId2 = new SqlParameter();
            dbParam_InstructionId2.ParameterName = "@InstructionPlayer2";
            dbParam_InstructionId2.Value = "";
            dbParam_InstructionId2.DbType = DbType.Decimal;
            dbParam_InstructionId2.Direction = ParameterDirection.Output;
            dbParam_InstructionId2.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId2);

            SqlParameter dbParam_InstructionId3 = new SqlParameter();
            dbParam_InstructionId3.ParameterName = "@InstructionPlayer3";
            dbParam_InstructionId3.Value = "";
            dbParam_InstructionId3.DbType = DbType.Decimal;
            dbParam_InstructionId3.Direction = ParameterDirection.Output;
            dbParam_InstructionId3.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId3);

            SqlParameter dbParam_InstructionId4 = new SqlParameter();
            dbParam_InstructionId4.ParameterName = "@InstructionPlayer4";
            dbParam_InstructionId4.Value = "";
            dbParam_InstructionId4.DbType = DbType.Decimal;
            dbParam_InstructionId4.Direction = ParameterDirection.Output;
            dbParam_InstructionId4.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId4);

            SqlParameter dbParam_InstructionId5 = new SqlParameter();
            dbParam_InstructionId5.ParameterName = "@InstructionPlayer5";
            dbParam_InstructionId5.Value = "";
            dbParam_InstructionId5.DbType = DbType.Decimal;
            dbParam_InstructionId5.Direction = ParameterDirection.Output;
            dbParam_InstructionId5.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId5);

            SqlParameter dbParam_InstructionId6 = new SqlParameter();
            dbParam_InstructionId6.ParameterName = "@InstructionPlayer6";
            dbParam_InstructionId6.Value = "";
            dbParam_InstructionId6.DbType = DbType.Decimal;
            dbParam_InstructionId6.Direction = ParameterDirection.Output;
            dbParam_InstructionId6.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId6);

            SqlParameter dbParam_InstructionId7 = new SqlParameter();
            dbParam_InstructionId7.ParameterName = "@InstructionPlayer7";
            dbParam_InstructionId7.Value = "";
            dbParam_InstructionId7.DbType = DbType.Decimal;
            dbParam_InstructionId7.Direction = ParameterDirection.Output;
            dbParam_InstructionId7.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId7);

            SqlParameter dbParam_InstructionId8 = new SqlParameter();
            dbParam_InstructionId8.ParameterName = "@InstructionPlayer8";
            dbParam_InstructionId8.Value = "";
            dbParam_InstructionId8.DbType = DbType.Decimal;
            dbParam_InstructionId8.Direction = ParameterDirection.Output;
            dbParam_InstructionId8.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId8);

            SqlParameter dbParam_InstructionId9 = new SqlParameter();
            dbParam_InstructionId9.ParameterName = "@InstructionPlayer9";
            dbParam_InstructionId9.Value = "";
            dbParam_InstructionId9.DbType = DbType.Decimal;
            dbParam_InstructionId9.Direction = ParameterDirection.Output;
            dbParam_InstructionId9.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId9);

            SqlParameter dbParam_InstructionId10 = new SqlParameter();
            dbParam_InstructionId10.ParameterName = "@InstructionPlayer10";
            dbParam_InstructionId10.Value = "";
            dbParam_InstructionId10.DbType = DbType.Decimal;
            dbParam_InstructionId10.Direction = ParameterDirection.Output;
            dbParam_InstructionId10.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId10);

            SqlParameter dbParam_InstructionId11 = new SqlParameter();
            dbParam_InstructionId11.ParameterName = "@InstructionPlayer11";
            dbParam_InstructionId11.Value = "";
            dbParam_InstructionId11.DbType = DbType.Decimal;
            dbParam_InstructionId11.Direction = ParameterDirection.Output;
            dbParam_InstructionId11.Size = 12;
            dbCommand.Parameters.Add(dbParam_InstructionId11);

            SqlParameter dbParam_AggressivenessId1 = new SqlParameter();
            dbParam_AggressivenessId1.ParameterName = "@AggressivenessPlayer1";
            dbParam_AggressivenessId1.Value = "";
            dbParam_AggressivenessId1.DbType = DbType.Decimal;
            dbParam_AggressivenessId1.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId1.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId1);

            SqlParameter dbParam_AggressivenessId2 = new SqlParameter();
            dbParam_AggressivenessId2.ParameterName = "@AggressivenessPlayer2";
            dbParam_AggressivenessId2.Value = "";
            dbParam_AggressivenessId2.DbType = DbType.Decimal;
            dbParam_AggressivenessId2.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId2.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId2);

            SqlParameter dbParam_AggressivenessId3 = new SqlParameter();
            dbParam_AggressivenessId3.ParameterName = "@AggressivenessPlayer3";
            dbParam_AggressivenessId3.Value = "";
            dbParam_AggressivenessId3.DbType = DbType.Decimal;
            dbParam_AggressivenessId3.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId3.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId3);

            SqlParameter dbParam_AggressivenessId4 = new SqlParameter();
            dbParam_AggressivenessId4.ParameterName = "@AggressivenessPlayer4";
            dbParam_AggressivenessId4.Value = "";
            dbParam_AggressivenessId4.DbType = DbType.Decimal;
            dbParam_AggressivenessId4.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId4.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId4);

            SqlParameter dbParam_AggressivenessId5 = new SqlParameter();
            dbParam_AggressivenessId5.ParameterName = "@AggressivenessPlayer5";
            dbParam_AggressivenessId5.Value = "";
            dbParam_AggressivenessId5.DbType = DbType.Decimal;
            dbParam_AggressivenessId5.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId5.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId5);

            SqlParameter dbParam_AggressivenessId6 = new SqlParameter();
            dbParam_AggressivenessId6.ParameterName = "@AggressivenessPlayer6";
            dbParam_AggressivenessId6.Value = "";
            dbParam_AggressivenessId6.DbType = DbType.Decimal;
            dbParam_AggressivenessId6.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId6.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId6);

            SqlParameter dbParam_AggressivenessId7 = new SqlParameter();
            dbParam_AggressivenessId7.ParameterName = "@AggressivenessPlayer7";
            dbParam_AggressivenessId7.Value = "";
            dbParam_AggressivenessId7.DbType = DbType.Decimal;
            dbParam_AggressivenessId7.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId7.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId7);

            SqlParameter dbParam_AggressivenessId8 = new SqlParameter();
            dbParam_AggressivenessId8.ParameterName = "@AggressivenessPlayer8";
            dbParam_AggressivenessId8.Value = "";
            dbParam_AggressivenessId8.DbType = DbType.Decimal;
            dbParam_AggressivenessId8.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId8.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId8);

            SqlParameter dbParam_AggressivenessId9 = new SqlParameter();
            dbParam_AggressivenessId9.ParameterName = "@AggressivenessPlayer9";
            dbParam_AggressivenessId9.Value = "";
            dbParam_AggressivenessId9.DbType = DbType.Decimal;
            dbParam_AggressivenessId9.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId9.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId9);

            SqlParameter dbParam_AggressivenessId10 = new SqlParameter();
            dbParam_AggressivenessId10.ParameterName = "@AggressivenessPlayer10";
            dbParam_AggressivenessId10.Value = "";
            dbParam_AggressivenessId10.DbType = DbType.Decimal;
            dbParam_AggressivenessId10.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId10.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId10);

            SqlParameter dbParam_AggressivenessId11 = new SqlParameter();
            dbParam_AggressivenessId11.ParameterName = "@AggressivenessPlayer11";
            dbParam_AggressivenessId11.Value = "";
            dbParam_AggressivenessId11.DbType = DbType.Decimal;
            dbParam_AggressivenessId11.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId11.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId11);

            SqlParameter dbParam_AggressivenessId12 = new SqlParameter();
            dbParam_AggressivenessId12.ParameterName = "@AggressivenessPlayer12";
            dbParam_AggressivenessId12.Value = "";
            dbParam_AggressivenessId12.DbType = DbType.Decimal;
            dbParam_AggressivenessId12.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId12.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId12);

            SqlParameter dbParam_AggressivenessId13 = new SqlParameter();
            dbParam_AggressivenessId13.ParameterName = "@AggressivenessPlayer13";
            dbParam_AggressivenessId13.Value = "";
            dbParam_AggressivenessId13.DbType = DbType.Decimal;
            dbParam_AggressivenessId13.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId13.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId13);

            SqlParameter dbParam_AggressivenessId14 = new SqlParameter();
            dbParam_AggressivenessId14.ParameterName = "@AggressivenessPlayer14";
            dbParam_AggressivenessId14.Value = "";
            dbParam_AggressivenessId14.DbType = DbType.Decimal;
            dbParam_AggressivenessId14.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId14.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId14);

            SqlParameter dbParam_AggressivenessId15 = new SqlParameter();
            dbParam_AggressivenessId15.ParameterName = "@AggressivenessPlayer15";
            dbParam_AggressivenessId15.Value = "";
            dbParam_AggressivenessId15.DbType = DbType.Decimal;
            dbParam_AggressivenessId15.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId15.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId15);

            SqlParameter dbParam_AggressivenessId16 = new SqlParameter();
            dbParam_AggressivenessId16.ParameterName = "@AggressivenessPlayer16";
            dbParam_AggressivenessId16.Value = "";
            dbParam_AggressivenessId16.DbType = DbType.Decimal;
            dbParam_AggressivenessId16.Direction = ParameterDirection.Output;
            dbParam_AggressivenessId16.Size = 2;
            dbCommand.Parameters.Add(dbParam_AggressivenessId16);

            SqlParameter dbParam_AttitudeId1 = new SqlParameter();
            dbParam_AttitudeId1.ParameterName = "@Attitudeplayer1";
            dbParam_AttitudeId1.Value = "";
            dbParam_AttitudeId1.DbType = DbType.Decimal;
            dbParam_AttitudeId1.Direction = ParameterDirection.Output;
            dbParam_AttitudeId1.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId1);

            SqlParameter dbParam_AttitudeId2 = new SqlParameter();
            dbParam_AttitudeId2.ParameterName = "@Attitudeplayer2";
            dbParam_AttitudeId2.Value = "";
            dbParam_AttitudeId2.DbType = DbType.Decimal;
            dbParam_AttitudeId2.Direction = ParameterDirection.Output;
            dbParam_AttitudeId2.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId2);

            SqlParameter dbParam_AttitudeId3 = new SqlParameter();
            dbParam_AttitudeId3.ParameterName = "@Attitudeplayer3";
            dbParam_AttitudeId3.Value = "";
            dbParam_AttitudeId3.DbType = DbType.Decimal;
            dbParam_AttitudeId3.Direction = ParameterDirection.Output;
            dbParam_AttitudeId3.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId3);

            SqlParameter dbParam_AttitudeId4 = new SqlParameter();
            dbParam_AttitudeId4.ParameterName = "@Attitudeplayer4";
            dbParam_AttitudeId4.Value = "";
            dbParam_AttitudeId4.DbType = DbType.Decimal;
            dbParam_AttitudeId4.Direction = ParameterDirection.Output;
            dbParam_AttitudeId4.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId4);

            SqlParameter dbParam_AttitudeId5 = new SqlParameter();
            dbParam_AttitudeId5.ParameterName = "@Attitudeplayer5";
            dbParam_AttitudeId5.Value = "";
            dbParam_AttitudeId5.DbType = DbType.Decimal;
            dbParam_AttitudeId5.Direction = ParameterDirection.Output;
            dbParam_AttitudeId5.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId5);

            SqlParameter dbParam_AttitudeId6 = new SqlParameter();
            dbParam_AttitudeId6.ParameterName = "@Attitudeplayer6";
            dbParam_AttitudeId6.Value = "";
            dbParam_AttitudeId6.DbType = DbType.Decimal;
            dbParam_AttitudeId6.Direction = ParameterDirection.Output;
            dbParam_AttitudeId6.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId6);

            SqlParameter dbParam_AttitudeId7 = new SqlParameter();
            dbParam_AttitudeId7.ParameterName = "@Attitudeplayer7";
            dbParam_AttitudeId7.Value = "";
            dbParam_AttitudeId7.DbType = DbType.Decimal;
            dbParam_AttitudeId7.Direction = ParameterDirection.Output;
            dbParam_AttitudeId7.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId7);

            SqlParameter dbParam_AttitudeId8 = new SqlParameter();
            dbParam_AttitudeId8.ParameterName = "@Attitudeplayer8";
            dbParam_AttitudeId8.Value = "";
            dbParam_AttitudeId8.DbType = DbType.Decimal;
            dbParam_AttitudeId8.Direction = ParameterDirection.Output;
            dbParam_AttitudeId8.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId8);

            SqlParameter dbParam_AttitudeId9 = new SqlParameter();
            dbParam_AttitudeId9.ParameterName = "@Attitudeplayer9";
            dbParam_AttitudeId9.Value = "";
            dbParam_AttitudeId9.DbType = DbType.Decimal;
            dbParam_AttitudeId9.Direction = ParameterDirection.Output;
            dbParam_AttitudeId9.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId9);

            SqlParameter dbParam_AttitudeId10 = new SqlParameter();
            dbParam_AttitudeId10.ParameterName = "@Attitudeplayer10";
            dbParam_AttitudeId10.Value = "";
            dbParam_AttitudeId10.DbType = DbType.Decimal;
            dbParam_AttitudeId10.Direction = ParameterDirection.Output;
            dbParam_AttitudeId10.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId10);

            SqlParameter dbParam_AttitudeId11 = new SqlParameter();
            dbParam_AttitudeId11.ParameterName = "@Attitudeplayer11";
            dbParam_AttitudeId11.Value = "";
            dbParam_AttitudeId11.DbType = DbType.Decimal;
            dbParam_AttitudeId11.Direction = ParameterDirection.Output;
            dbParam_AttitudeId11.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId11);

            SqlParameter dbParam_AttitudeId12 = new SqlParameter();
            dbParam_AttitudeId12.ParameterName = "@Attitudeplayer12";
            dbParam_AttitudeId12.Value = "";
            dbParam_AttitudeId12.DbType = DbType.Decimal;
            dbParam_AttitudeId12.Direction = ParameterDirection.Output;
            dbParam_AttitudeId12.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId12);

            SqlParameter dbParam_AttitudeId13 = new SqlParameter();
            dbParam_AttitudeId13.ParameterName = "@Attitudeplayer13";
            dbParam_AttitudeId13.Value = "";
            dbParam_AttitudeId13.DbType = DbType.Decimal;
            dbParam_AttitudeId13.Direction = ParameterDirection.Output;
            dbParam_AttitudeId13.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId13);

            SqlParameter dbParam_AttitudeId14 = new SqlParameter();
            dbParam_AttitudeId14.ParameterName = "@Attitudeplayer14";
            dbParam_AttitudeId14.Value = "";
            dbParam_AttitudeId14.DbType = DbType.Decimal;
            dbParam_AttitudeId14.Direction = ParameterDirection.Output;
            dbParam_AttitudeId14.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId14);

            SqlParameter dbParam_AttitudeId15 = new SqlParameter();
            dbParam_AttitudeId15.ParameterName = "@Attitudeplayer15";
            dbParam_AttitudeId15.Value = "";
            dbParam_AttitudeId15.DbType = DbType.Decimal;
            dbParam_AttitudeId15.Direction = ParameterDirection.Output;
            dbParam_AttitudeId15.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId15);

            SqlParameter dbParam_AttitudeId16 = new SqlParameter();
            dbParam_AttitudeId16.ParameterName = "@Attitudeplayer16";
            dbParam_AttitudeId16.Value = "";
            dbParam_AttitudeId16.DbType = DbType.Decimal;
            dbParam_AttitudeId16.Direction = ParameterDirection.Output;
            dbParam_AttitudeId16.Size = 2;
            dbCommand.Parameters.Add(dbParam_AttitudeId16);

            SqlParameter dbParam_PreferredActionId1 = new SqlParameter();
            dbParam_PreferredActionId1.ParameterName = "@PreferredActionplayer1";
            dbParam_PreferredActionId1.Value = "";
            dbParam_PreferredActionId1.DbType = DbType.Decimal;
            dbParam_PreferredActionId1.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId1.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId1);

            SqlParameter dbParam_PreferredActionId2 = new SqlParameter();
            dbParam_PreferredActionId2.ParameterName = "@PreferredActionplayer2";
            dbParam_PreferredActionId2.Value = "";
            dbParam_PreferredActionId2.DbType = DbType.Decimal;
            dbParam_PreferredActionId2.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId2.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId2);

            SqlParameter dbParam_PreferredActionId3 = new SqlParameter();
            dbParam_PreferredActionId3.ParameterName = "@PreferredActionplayer3";
            dbParam_PreferredActionId3.Value = "";
            dbParam_PreferredActionId3.DbType = DbType.Decimal;
            dbParam_PreferredActionId3.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId3.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId3);

            SqlParameter dbParam_PreferredActionId4 = new SqlParameter();
            dbParam_PreferredActionId4.ParameterName = "@PreferredActionplayer4";
            dbParam_PreferredActionId4.Value = "";
            dbParam_PreferredActionId4.DbType = DbType.Decimal;
            dbParam_PreferredActionId4.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId4.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId4);

            SqlParameter dbParam_PreferredActionId5 = new SqlParameter();
            dbParam_PreferredActionId5.ParameterName = "@PreferredActionplayer5";
            dbParam_PreferredActionId5.Value = "";
            dbParam_PreferredActionId5.DbType = DbType.Decimal;
            dbParam_PreferredActionId5.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId5.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId5);

            SqlParameter dbParam_PreferredActionId6 = new SqlParameter();
            dbParam_PreferredActionId6.ParameterName = "@PreferredActionplayer6";
            dbParam_PreferredActionId6.Value = "";
            dbParam_PreferredActionId6.DbType = DbType.Decimal;
            dbParam_PreferredActionId6.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId6.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId6);

            SqlParameter dbParam_PreferredActionId7 = new SqlParameter();
            dbParam_PreferredActionId7.ParameterName = "@PreferredActionplayer7";
            dbParam_PreferredActionId7.Value = "";
            dbParam_PreferredActionId7.DbType = DbType.Decimal;
            dbParam_PreferredActionId7.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId7.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId7);

            SqlParameter dbParam_PreferredActionId8 = new SqlParameter();
            dbParam_PreferredActionId8.ParameterName = "@PreferredActionplayer8";
            dbParam_PreferredActionId8.Value = "";
            dbParam_PreferredActionId8.DbType = DbType.Decimal;
            dbParam_PreferredActionId8.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId8.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId8);

            SqlParameter dbParam_PreferredActionId9 = new SqlParameter();
            dbParam_PreferredActionId9.ParameterName = "@PreferredActionplayer9";
            dbParam_PreferredActionId9.Value = "";
            dbParam_PreferredActionId9.DbType = DbType.Decimal;
            dbParam_PreferredActionId9.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId9.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId9);

            SqlParameter dbParam_PreferredActionId10 = new SqlParameter();
            dbParam_PreferredActionId10.ParameterName = "@PreferredActionplayer10";
            dbParam_PreferredActionId10.Value = "";
            dbParam_PreferredActionId10.DbType = DbType.Decimal;
            dbParam_PreferredActionId10.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId10.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId10);

            SqlParameter dbParam_PreferredActionId11 = new SqlParameter();
            dbParam_PreferredActionId11.ParameterName = "@PreferredActionplayer11";
            dbParam_PreferredActionId11.Value = "";
            dbParam_PreferredActionId11.DbType = DbType.Decimal;
            dbParam_PreferredActionId11.Direction = ParameterDirection.Output;
            dbParam_PreferredActionId11.Size = 2;
            dbCommand.Parameters.Add(dbParam_PreferredActionId11);

            SqlParameter dbParam_TeamAggressiveness = new SqlParameter();
            dbParam_TeamAggressiveness.ParameterName = "@TeamAggressiveness";
            dbParam_TeamAggressiveness.Value = "";
            dbParam_TeamAggressiveness.DbType = DbType.Decimal;
            dbParam_TeamAggressiveness.Direction = ParameterDirection.Output;
            dbParam_TeamAggressiveness.Size = 2;
            dbCommand.Parameters.Add(dbParam_TeamAggressiveness);


            SqlParameter dbParam_TeamAttitude = new SqlParameter();
            dbParam_TeamAttitude.ParameterName = "@TeamAttitude";
            dbParam_TeamAttitude.Value = "";
            dbParam_TeamAttitude.DbType = DbType.Decimal;
            dbParam_TeamAttitude.Direction = ParameterDirection.Output;
            dbParam_TeamAttitude.Size = 2;
            dbCommand.Parameters.Add(dbParam_TeamAttitude);


            SqlParameter dbParam_Captain = new SqlParameter();
            dbParam_Captain.ParameterName = "@Captain";
            dbParam_Captain.Value = "";
            dbParam_Captain.DbType = DbType.Decimal;
            dbParam_Captain.Direction = ParameterDirection.Output;
            dbParam_Captain.Size = 2;
            dbCommand.Parameters.Add(dbParam_Captain);


            SqlParameter dbParam_SetPiecesTaker = new SqlParameter();
            dbParam_SetPiecesTaker.ParameterName = "@SetPiecesTaker";
            dbParam_SetPiecesTaker.Value = "";
            dbParam_SetPiecesTaker.DbType = DbType.Decimal;
            dbParam_SetPiecesTaker.Direction = ParameterDirection.Output;
            dbParam_SetPiecesTaker.Size = 2;
            dbCommand.Parameters.Add(dbParam_SetPiecesTaker);



            try
            {

                dbConnection.Open();
                dbCommand.ExecuteScalar();
                //this.DropDownList1.SelectedValue = dbParam_PlayerId1.Value.ToString();
                this.Player1DropDownList.SelectedValue = dbParam_PlayerId1.Value.ToString();
                this.Player2DropDownList.SelectedValue = dbParam_PlayerId2.Value.ToString();
                this.Player3DropDownList.SelectedValue = dbParam_PlayerId3.Value.ToString();
                this.Player4DropDownList.SelectedValue = dbParam_PlayerId4.Value.ToString();
                this.Player5DropDownList.SelectedValue = dbParam_PlayerId5.Value.ToString();
                this.Player6DropDownList.SelectedValue = dbParam_PlayerId6.Value.ToString();
                this.Player7DropDownList.SelectedValue = dbParam_PlayerId7.Value.ToString();
                this.Player8DropDownList.SelectedValue = dbParam_PlayerId8.Value.ToString();
                this.Player9DropDownList.SelectedValue = dbParam_PlayerId9.Value.ToString();
                this.Player10DropDownList.SelectedValue = dbParam_PlayerId10.Value.ToString();
                this.Player11DropDownList.SelectedValue = dbParam_PlayerId11.Value.ToString();
                this.Player12DropDownList.SelectedValue = dbParam_PlayerId12.Value.ToString();
                this.Player13DropDownList.SelectedValue = dbParam_PlayerId13.Value.ToString();
                this.Player14DropDownList.SelectedValue = dbParam_PlayerId14.Value.ToString();
                this.Player15DropDownList.SelectedValue = dbParam_PlayerId15.Value.ToString();
                this.Player16DropDownList.SelectedValue = dbParam_PlayerId16.Value.ToString();
                this.Penalty1DropDownList.SelectedValue = dbParam_PenaltyId1.Value.ToString();
                this.Penalty2DropDownList.SelectedValue = dbParam_PenaltyId2.Value.ToString();
                this.Penalty3DropDownList.SelectedValue = dbParam_PenaltyId3.Value.ToString();
                this.Penalty4DropDownList.SelectedValue = dbParam_PenaltyId4.Value.ToString();
                this.Penalty5DropDownList.SelectedValue = dbParam_PenaltyId5.Value.ToString();
                this.Penalty6DropDownList.SelectedValue = dbParam_PenaltyId6.Value.ToString();
                this.Penalty7DropDownList.SelectedValue = dbParam_PenaltyId7.Value.ToString();
                this.Penalty8DropDownList.SelectedValue = dbParam_PenaltyId8.Value.ToString();
                this.Penalty9DropDownList.SelectedValue = dbParam_PenaltyId9.Value.ToString();
                this.Penalty10DropDownList.SelectedValue = dbParam_PenaltyId10.Value.ToString();
                this.Penalty11DropDownList.SelectedValue = dbParam_PenaltyId11.Value.ToString();
                PositionPlayer1.Value = dbParam_PositionId1.Value.ToString();
                PositionPlayer2.Value = dbParam_PositionId2.Value.ToString();
                PositionPlayer3.Value = dbParam_PositionId3.Value.ToString();
                PositionPlayer4.Value = dbParam_PositionId4.Value.ToString();
                PositionPlayer5.Value = dbParam_PositionId5.Value.ToString();
                PositionPlayer6.Value = dbParam_PositionId6.Value.ToString();
                PositionPlayer7.Value = dbParam_PositionId7.Value.ToString();
                PositionPlayer8.Value = dbParam_PositionId8.Value.ToString();
                PositionPlayer9.Value = dbParam_PositionId9.Value.ToString();
                PositionPlayer10.Value = dbParam_PositionId10.Value.ToString();
                PositionPlayer11.Value = dbParam_PositionId11.Value.ToString();
                // TODO - change this to return from the initial SP
                this.PositionLabel1.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer1.Value, Language.Value);
                this.PositionLabel2.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer2.Value, Language.Value);
                this.PositionLabel3.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer3.Value, Language.Value);
                this.PositionLabel4.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer4.Value, Language.Value);
                this.PositionLabel5.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer5.Value, Language.Value);
                this.PositionLabel6.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer6.Value, Language.Value);
                this.PositionLabel7.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer7.Value, Language.Value);
                this.PositionLabel8.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer8.Value, Language.Value);
                this.PositionLabel9.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer9.Value, Language.Value);
                this.PositionLabel10.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer10.Value, Language.Value);
                this.PositionLabel11.Text = GND.ReadNivdalStringData("@PositionId", "@Language", "Nivdal_GetPositionStringByIdProc", PositionPlayer11.Value, Language.Value);
                this.Position12DropDownList.SelectedValue = dbParam_PositionId12.Value.ToString();
                this.Position13DropDownList.SelectedValue = dbParam_PositionId13.Value.ToString();
                this.Position14DropDownList.SelectedValue = dbParam_PositionId14.Value.ToString();
                this.Position15DropDownList.SelectedValue = dbParam_PositionId15.Value.ToString();
                this.Position16DropDownList.SelectedValue = dbParam_PositionId16.Value.ToString();
                this.Instruction1DropDownList.SelectedValue = dbParam_InstructionId1.Value.ToString();
                this.Instruction2DropDownList.SelectedValue = dbParam_InstructionId2.Value.ToString();
                this.Instruction3DropDownList.SelectedValue = dbParam_InstructionId3.Value.ToString();
                this.Instruction4DropDownList.SelectedValue = dbParam_InstructionId4.Value.ToString();
                this.Instruction5DropDownList.SelectedValue = dbParam_InstructionId5.Value.ToString();
                this.Instruction6DropDownList.SelectedValue = dbParam_InstructionId6.Value.ToString();
                this.Instruction7DropDownList.SelectedValue = dbParam_InstructionId7.Value.ToString();
                this.Instruction8DropDownList.SelectedValue = dbParam_InstructionId8.Value.ToString();
                this.Instruction9DropDownList.SelectedValue = dbParam_InstructionId9.Value.ToString();
                this.Instruction10DropDownList.SelectedValue = dbParam_InstructionId10.Value.ToString();
                this.Instruction11DropDownList.SelectedValue = dbParam_InstructionId11.Value.ToString();
                this.PreferredAction1DropDownList.SelectedValue = dbParam_PreferredActionId1.Value.ToString();
                this.PreferredAction2DropDownList.SelectedValue = dbParam_PreferredActionId2.Value.ToString();
                this.PreferredAction3DropDownList.SelectedValue = dbParam_PreferredActionId3.Value.ToString();
                this.PreferredAction4DropDownList.SelectedValue = dbParam_PreferredActionId4.Value.ToString();
                this.PreferredAction5DropDownList.SelectedValue = dbParam_PreferredActionId5.Value.ToString();
                this.PreferredAction6DropDownList.SelectedValue = dbParam_PreferredActionId6.Value.ToString();
                this.PreferredAction7DropDownList.SelectedValue = dbParam_PreferredActionId7.Value.ToString();
                this.PreferredAction8DropDownList.SelectedValue = dbParam_PreferredActionId8.Value.ToString();
                this.PreferredAction9DropDownList.SelectedValue = dbParam_PreferredActionId9.Value.ToString();
                this.PreferredAction10DropDownList.SelectedValue = dbParam_PreferredActionId10.Value.ToString();
                this.PreferredAction11DropDownList.SelectedValue = dbParam_PreferredActionId11.Value.ToString();
                this.TeamAggressivenessDropDownList.SelectedValue = dbParam_TeamAggressiveness.Value.ToString();
                this.TeamAttitudeDropDownList.SelectedValue = dbParam_TeamAttitude.Value.ToString();
                this.CaptainDropDownList.SelectedValue = dbParam_Captain.Value.ToString();
                this.PiecesTakerDropDownList.SelectedValue = dbParam_SetPiecesTaker.Value.ToString();
            }
            catch (Exception SQLDBException)
            {
                this.Message.ForeColor = System.Drawing.Color.Red;
                this.Message.Text = Convert.ToString(SQLDBException);
            }

            finally
            {
                dbConnection.Close();
            }


            //this.DropDownList1.SelectedValue = dbParam_PlayerId1.ToString();
        }

        //protected void PlayerDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
        //{

        //    string sValue = ((DropDownList)sender).SelectedValue;
        //    string sName = ((DropDownList)sender).ID;
        //    //Message.Text = sName;
        //    int DDLId = 0;

        //    switch (((DropDownList)sender).ID)
        //    {
        //        case "Player1DropDownList":
        //            DDLId = 1;
        //            break;
        //        case "Player2DropDownList":
        //            DDLId = 2;
        //            break;
        //        case "Player3DropDownList":
        //            DDLId = 3;
        //            break;
        //        case "Player4DropDownList":
        //            DDLId = 4;
        //            break;
        //        case "Player5DropDownList":
        //            DDLId = 5;
        //            break;
        //        case "Player6DropDownList":
        //            DDLId = 6;
        //            break;
        //        case "Player7DropDownList":
        //            DDLId = 7;
        //            break;
        //        case "Player8DropDownList":
        //            DDLId = 8;
        //            break;
        //        case "Player9DropDownList":
        //            DDLId = 9;
        //            break;
        //        case "Player10DropDownList":
        //            DDLId = 10;
        //            break;
        //        case "Player11DropDownList":
        //            DDLId = 11;
        //            break;
        //        case "Player12DropDownList":
        //            DDLId = 12;
        //            break;
        //        case "Player13DropDownList":
        //            DDLId = 13;
        //            break;
        //        case "Player14DropDownList":
        //            DDLId = 14;
        //            break;
        //        case "Player15DropDownList":
        //            DDLId = 15;
        //            break;
        //        case "Player16DropDownList":
        //            DDLId = 16;
        //            break;
        //        default:
        //            Message.Text = "No DDL value was choosen";
        //            break;
        //    }

        //    //if (this.Player2DropDownList.SelectedValue == sValue)
        //    // this.Player2DropDownList.SelectedValue = "0";
        //    SetDDLs(sValue, DDLId, "Player", 16);

        //}


        protected void PenaltyDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            bool OKPenalty = false;
            string sValue = ((DropDownList)sender).SelectedValue;
            string sName = ((DropDownList)sender).ID;
            //Message.Text = sName;
            int DDLId = 0;

            switch (((DropDownList)sender).ID)
            {
                case "Penalty1DropDownList":
                    DDLId = 1;
                    break;
                case "Penalty2DropDownList":
                    DDLId = 2;
                    break;
                case "Penalty3DropDownList":
                    DDLId = 3;
                    break;
                case "Penalty4DropDownList":
                    DDLId = 4;
                    break;
                case "Penalty5DropDownList":
                    DDLId = 5;
                    break;
                case "Penalty6DropDownList":
                    DDLId = 6;
                    break;
                case "Penalty7DropDownList":
                    DDLId = 7;
                    break;
                case "Penalty8DropDownList":
                    DDLId = 8;
                    break;
                case "Penalty9DropDownList":
                    DDLId = 9;
                    break;
                case "Penalty10DropDownList":
                    DDLId = 10;
                    break;
                case "Penalty11DropDownList":
                    DDLId = 11;
                    break;
                default:
                    Message.Text = Resources.Resource.MatchInstructionsStep2_NoDDLChoosen;
                    break;
            }

            for (int i = 1; i <= 11; i++)
            {
                string PlayerDDLName = "Player" + i + "DropDownList";
                DropDownList D = (DropDownList)this.Message.FindControl(PlayerDDLName);

                if (D.SelectedValue == sValue)
                    OKPenalty = true;
            }

            Label PEL = (Label)this.Message.FindControl(sName + "ErrorLabel");
            if (OKPenalty)
            {
                Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
                SOB.Enabled = true;
                PEL.Text = "";
                SetDDLs(sValue, DDLId, "Penalty", 11);
            }
            else
            {
                Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
                SOB.Enabled = false;
                PEL.Text = Resources.Resource.MatchInstructionsStep2_PenaltyNotFrom16Players;
            }



        }

        //protected void PositionDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
        //{

        //    string sValue = ((DropDownList)sender).SelectedValue;
        //    string sName = ((DropDownList)sender).ID;
        //    Message.Text = sName;
        //    int DDLId = 0;

        //    switch (((DropDownList)sender).ID)
        //    {
        //        case "Position1DropDownList":
        //            DDLId = 1;
        //            break;
        //        case "Position2DropDownList":
        //            DDLId = 2;
        //            break;
        //        case "Position3DropDownList":
        //            DDLId = 3;
        //            break;
        //        case "Position4DropDownList":
        //            DDLId = 4;
        //            break;
        //        case "Position5DropDownList":
        //            DDLId = 5;
        //            break;
        //        case "Position6DropDownList":
        //            DDLId = 6;
        //            break;
        //        case "Position7DropDownList":
        //            DDLId = 7;
        //            break;
        //        case "Position8DropDownList":
        //            DDLId = 8;
        //            break;
        //        case "Position9DropDownList":
        //            DDLId = 9;
        //            break;
        //        case "Position10DropDownList":
        //            DDLId = 10;
        //            break;
        //        case "Position11DropDownList":
        //            DDLId = 11;
        //            break;
        //        default:
        //            Message.Text = "No DDL value was choosen";
        //            break;
        //    }

        //    SetDDLs(sValue, DDLId, "Position", 11);

        //}

        //protected void CaptainDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
        //{
        //    bool OKCaptain = false;
        //    Label TIEL = (Label)this.Message.FindControl("TeamInstructionsErrorLabel");
        //    string sValue = ((DropDownList)sender).SelectedValue;
        //    for (int i = 1; i <= 11; i++)
        //    {
        //        string DDLName = "Player" + i + "DropDownList";
        //        DropDownList D = (DropDownList)this.Message.FindControl(DDLName);

        //        if (D.SelectedValue == sValue)
        //        {
        //            OKCaptain = true;
        //        }


        //    }
        //    if (!OKCaptain)
        //    {
        //        Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
        //        SOB.Enabled = false;
        //        TIEL.ForeColor = System.Drawing.Color.Red;
        //        TIEL.Text = " The Captain must be one of the 11 players ";
        //    }
        //    else
        //    {
        //        Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
        //        SOB.Enabled = true;
        //        TIEL.Text = "";

        //    }
        //}

        //protected void PiecesTakerDropDownList_SelectedIndexChanged(object sender, System.EventArgs e)
        //{
        //    bool OKPiecesTaker = false;
        //    Label TIEL = (Label)this.Message.FindControl("TeamInstructionsErrorLabel");
        //    string sValue = ((DropDownList)sender).SelectedValue;
        //    for (int i = 1; i <= 11; i++)
        //    {
        //        string DDLName = "Player" + i + "DropDownList";
        //        DropDownList D = (DropDownList)this.Message.FindControl(DDLName);

        //        if (D.SelectedValue == sValue)
        //        {
        //            OKPiecesTaker = true;
        //        }


        //    }
        //    if (!OKPiecesTaker)
        //    {
        //        Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
        //        SOB.Enabled = false;
        //        SOB.Visible = false;
        //        TIEL.ForeColor = System.Drawing.Color.Red;
        //        TIEL.Text = " The PiecesTaker must be one of the 11 players ";
        //    }
        //    else
        //    {
        //        Button SOB = (Button)this.Message.FindControl("SubmitOrderButton");
        //        SOB.Enabled = true;
        //        TIEL.Text = "";

        //    }
        //}





        protected void SetDDLs(string sValue, int CurrentVal, string DDL, int MaxValue)
        {
            for (int i = 1; i <= MaxValue; i++)
            {
                if (i != CurrentVal)
                {
                    string DDLName = DDL + i + "DropDownList";
                    DropDownList D = (DropDownList)this.Message.FindControl(DDLName);
                    //Message.Text = D.SelectedValue;
                    //Message.Text = DDLName;

                    if (D.SelectedValue == sValue)
                    {
                        D.SelectedValue = "0";
                        //Message.Text = D.SelectedValue;
                    }
                    //DropDownList E = (DropDownList)this.Message.FindControl("Player2DropDownList");
                    //Message.Text = E.SelectedValue; 

                }

            }


        }

        protected bool CheckInstructionsForChosenPlayer()
        {
            bool ReturnValue = true;
            for (int i = 1; i <= 11; i++)
            {
                string PlayerDDLName = "Player" + i + "DropDownList";
                string InstructionDDLName = "Instruction" + i + "DropDownList";
                string AggressivenessDDLName = "Aggressiveness" + i + "DropDownList";
                string AttitudeDDLName = "Attitude" + i + "DropDownList";
                string PreferredActionDDLName = "PreferredAction" + i + "DropDownList";


                DropDownList PlayerDDL = (DropDownList)this.Message.FindControl(PlayerDDLName);
                DropDownList InstructionDDL = (DropDownList)this.Message.FindControl(InstructionDDLName);
                DropDownList PreferredActionDDL = (DropDownList)this.Message.FindControl(PreferredActionDDLName);


                if ((PlayerDDL.SelectedValue != "0") && ((InstructionDDL.SelectedValue == "0") || (PreferredActionDDL.SelectedValue == "0")))
                {

                    ReturnValue = false;
                }
            }

            for (int i = 12; i <= 16; i++)
            {
                string PlayerDDLName = "Player" + i + "DropDownList";
                string PositionDDLName = "Position" + i + "DropDownList";
                //string InstructionDDLName = "Instruction" + i + "DropDownList";
                //string PreferredActionDDLName = "PreferredAction" + i + "DropDownList";


                DropDownList PlayerDDL = (DropDownList)this.Message.FindControl(PlayerDDLName);
                DropDownList PositionDDL = (DropDownList)this.Message.FindControl(PositionDDLName);


                if ((PlayerDDL.SelectedValue != "0") && ((PositionDDL.SelectedValue == "0")))
                {
                    ReturnValue = false;
                }

            }
            return ReturnValue;

        }


        protected void SubmitOrderButton_Click(object sender, EventArgs e)
        {
            this.Message.ForeColor = System.Drawing.Color.Green;
            this.PlayersToSubmitErrorLabel.Text = "";
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
            OnlineUser ou = (OnlineUser)Session["User"];
            // THE FOLL
            //PTSEL.Text = OKSubmit.ToString();
            //first check Limitation 4
            bool OKPlayersToSubmit = false;
            OKPlayersToSubmit = CheckInstructionsForChosenPlayer();
            if (!OKPlayersToSubmit)
                this.PlayersToSubmitErrorLabel.Text = Resources.Resource.MatchInstructionsStep2_NotAllPlayerInstructionWereChosen;
            else //submit the form
            {
                string UserId = null;
                string MatchId = null;
                MatchId = MatchIdHiddenField.Value;
                if (MatchId == null)
                    Response.Redirect("GeneralMessage.aspx?MessageString=l43ZZOTLOB");
                UserId = ou.UserId;
                if (UserId == null)
                    Response.Redirect("GeneralMessage.aspx?MessageString=l4331EOTHBB");

                string conn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                System.Data.IDbConnection dbConnection = new System.Data.SqlClient.SqlConnection(conn);
                System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();
                dbCommand.CommandText = "Nivdal_AssignMatchOrders";
                dbCommand.CommandType = CommandType.StoredProcedure;
                dbCommand.Connection = dbConnection;

                SqlParameter dbParam_UserId = new SqlParameter();
                dbParam_UserId.ParameterName = "@UserId";
                dbParam_UserId.Value = UserId;
                dbParam_UserId.DbType = DbType.String;
                dbCommand.Parameters.Add(dbParam_UserId);

                SqlParameter dbParam_MatchId = new SqlParameter();
                dbParam_MatchId.ParameterName = "@MatchId";
                dbParam_MatchId.Value = MatchId;
                dbParam_MatchId.DbType = DbType.String;
                dbCommand.Parameters.Add(dbParam_MatchId);

                SqlParameter dbParam_Default = new SqlParameter();
                dbParam_Default.ParameterName = "@Default";
                dbParam_Default.Value = this.SADCheckBox.Checked;
                dbParam_Default.DbType = DbType.String;
                dbCommand.Parameters.Add(dbParam_Default);

                SqlParameter dbParam_PlayerId1 = new SqlParameter();
                dbParam_PlayerId1.ParameterName = "@Player1";
                dbParam_PlayerId1.Value = this.Player1DropDownList.SelectedValue;
                dbParam_PlayerId1.DbType = DbType.Decimal;
                dbParam_PlayerId1.Direction = ParameterDirection.Input;
                dbParam_PlayerId1.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId1);

                SqlParameter dbParam_PlayerId2 = new SqlParameter();
                dbParam_PlayerId2.ParameterName = "@Player2";
                dbParam_PlayerId2.Value = this.Player2DropDownList.SelectedValue;
                dbParam_PlayerId2.DbType = DbType.Decimal;
                dbParam_PlayerId2.Direction = ParameterDirection.Input;
                dbParam_PlayerId2.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId2);

                SqlParameter dbParam_PlayerId3 = new SqlParameter();
                dbParam_PlayerId3.ParameterName = "@Player3";
                dbParam_PlayerId3.Value = this.Player3DropDownList.SelectedValue; ;
                dbParam_PlayerId3.DbType = DbType.Decimal;
                dbParam_PlayerId3.Direction = ParameterDirection.Input;
                dbParam_PlayerId3.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId3);

                SqlParameter dbParam_PlayerId4 = new SqlParameter();
                dbParam_PlayerId4.ParameterName = "@Player4";
                dbParam_PlayerId4.Value = this.Player4DropDownList.SelectedValue; ;
                dbParam_PlayerId4.DbType = DbType.Decimal;
                dbParam_PlayerId4.Direction = ParameterDirection.Input;
                dbParam_PlayerId4.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId4);

                SqlParameter dbParam_PlayerId5 = new SqlParameter();
                dbParam_PlayerId5.ParameterName = "@Player5";
                dbParam_PlayerId5.Value = this.Player5DropDownList.SelectedValue;
                dbParam_PlayerId5.DbType = DbType.Decimal;
                dbParam_PlayerId5.Direction = ParameterDirection.Input;
                dbParam_PlayerId5.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId5);

                SqlParameter dbParam_PlayerId6 = new SqlParameter();
                dbParam_PlayerId6.ParameterName = "@Player6";
                dbParam_PlayerId6.Value = this.Player6DropDownList.SelectedValue;
                dbParam_PlayerId6.DbType = DbType.Decimal;
                dbParam_PlayerId6.Direction = ParameterDirection.Input;
                dbParam_PlayerId6.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId6);

                SqlParameter dbParam_PlayerId7 = new SqlParameter();
                dbParam_PlayerId7.ParameterName = "@Player7";
                dbParam_PlayerId7.Value = this.Player7DropDownList.SelectedValue;
                dbParam_PlayerId7.DbType = DbType.Decimal;
                dbParam_PlayerId7.Direction = ParameterDirection.Input;
                dbParam_PlayerId7.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId7);

                SqlParameter dbParam_PlayerId8 = new SqlParameter();
                dbParam_PlayerId8.ParameterName = "@Player8";
                dbParam_PlayerId8.Value = this.Player8DropDownList.SelectedValue;
                dbParam_PlayerId8.DbType = DbType.Decimal;
                dbParam_PlayerId8.Direction = ParameterDirection.Input;
                dbParam_PlayerId8.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId8);

                SqlParameter dbParam_PlayerId9 = new SqlParameter();
                dbParam_PlayerId9.ParameterName = "@Player9";
                dbParam_PlayerId9.Value = this.Player9DropDownList.SelectedValue;
                dbParam_PlayerId9.DbType = DbType.Decimal;
                dbParam_PlayerId9.Direction = ParameterDirection.Input;
                dbParam_PlayerId9.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId9);

                SqlParameter dbParam_PlayerId10 = new SqlParameter();
                dbParam_PlayerId10.ParameterName = "@Player10";
                dbParam_PlayerId10.Value = this.Player10DropDownList.SelectedValue;
                dbParam_PlayerId10.DbType = DbType.Decimal;
                dbParam_PlayerId10.Direction = ParameterDirection.Input;
                dbParam_PlayerId10.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId10);

                SqlParameter dbParam_PlayerId11 = new SqlParameter();
                dbParam_PlayerId11.ParameterName = "@Player11";
                dbParam_PlayerId11.Value = this.Player11DropDownList.SelectedValue;
                dbParam_PlayerId11.DbType = DbType.Decimal;
                dbParam_PlayerId11.Direction = ParameterDirection.Input;
                dbParam_PlayerId11.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId11);

                SqlParameter dbParam_PlayerId12 = new SqlParameter();
                dbParam_PlayerId12.ParameterName = "@Player12";
                dbParam_PlayerId12.Value = this.Player12DropDownList.SelectedValue;
                dbParam_PlayerId12.DbType = DbType.Decimal;
                dbParam_PlayerId12.Direction = ParameterDirection.Input;
                dbParam_PlayerId12.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId12);

                SqlParameter dbParam_PlayerId13 = new SqlParameter();
                dbParam_PlayerId13.ParameterName = "@Player13";
                dbParam_PlayerId13.Value = this.Player13DropDownList.SelectedValue;
                dbParam_PlayerId13.DbType = DbType.Decimal;
                dbParam_PlayerId13.Direction = ParameterDirection.Input;
                dbParam_PlayerId13.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId13);

                SqlParameter dbParam_PlayerId14 = new SqlParameter();
                dbParam_PlayerId14.ParameterName = "@Player14";
                dbParam_PlayerId14.Value = this.Player14DropDownList.SelectedValue;
                dbParam_PlayerId14.DbType = DbType.Decimal;
                dbParam_PlayerId14.Direction = ParameterDirection.Input;
                dbParam_PlayerId14.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId14);

                SqlParameter dbParam_PlayerId15 = new SqlParameter();
                dbParam_PlayerId15.ParameterName = "@Player15";
                dbParam_PlayerId15.Value = this.Player15DropDownList.SelectedValue;
                dbParam_PlayerId15.DbType = DbType.Decimal;
                dbParam_PlayerId15.Direction = ParameterDirection.Input;
                dbParam_PlayerId15.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId15);

                SqlParameter dbParam_PlayerId16 = new SqlParameter();
                dbParam_PlayerId16.ParameterName = "@Player16";
                dbParam_PlayerId16.Value = this.Player16DropDownList.SelectedValue;
                dbParam_PlayerId16.DbType = DbType.Decimal;
                dbParam_PlayerId16.Direction = ParameterDirection.Input;
                dbParam_PlayerId16.Size = 12;
                dbCommand.Parameters.Add(dbParam_PlayerId16);

                SqlParameter dbParam_PenaltyId1 = new SqlParameter();
                dbParam_PenaltyId1.ParameterName = "@Penalty1Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId1.Value = this.Penalty1DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId1.Value = "0";
                dbParam_PenaltyId1.DbType = DbType.Decimal;
                dbParam_PenaltyId1.Direction = ParameterDirection.Input;
                dbParam_PenaltyId1.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId1);

                SqlParameter dbParam_PenaltyId2 = new SqlParameter();
                dbParam_PenaltyId2.ParameterName = "@Penalty2Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId2.Value = this.Penalty2DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId2.Value = "0";
                dbParam_PenaltyId2.DbType = DbType.Decimal;
                dbParam_PenaltyId2.Direction = ParameterDirection.Input;
                dbParam_PenaltyId2.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId2);

                SqlParameter dbParam_PenaltyId3 = new SqlParameter();
                dbParam_PenaltyId3.ParameterName = "@Penalty3Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId3.Value = this.Penalty3DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId3.Value = "0";
                dbParam_PenaltyId3.DbType = DbType.Decimal;
                dbParam_PenaltyId3.Direction = ParameterDirection.Input;
                dbParam_PenaltyId3.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId3);

                SqlParameter dbParam_PenaltyId4 = new SqlParameter();
                dbParam_PenaltyId4.ParameterName = "@Penalty4Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId4.Value = this.Penalty4DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId4.Value = "0";
                dbParam_PenaltyId4.DbType = DbType.Decimal;
                dbParam_PenaltyId4.Direction = ParameterDirection.Input;
                dbParam_PenaltyId4.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId4);

                SqlParameter dbParam_PenaltyId5 = new SqlParameter();
                dbParam_PenaltyId5.ParameterName = "@Penalty5Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId5.Value = this.Penalty5DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId5.Value = "0";
                dbParam_PenaltyId5.DbType = DbType.Decimal;
                dbParam_PenaltyId5.Direction = ParameterDirection.Input;
                dbParam_PenaltyId5.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId5);

                SqlParameter dbParam_PenaltyId6 = new SqlParameter();
                dbParam_PenaltyId6.ParameterName = "@Penalty6Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId6.Value = this.Penalty6DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId6.Value = "0";
                dbParam_PenaltyId6.DbType = DbType.Decimal;
                dbParam_PenaltyId6.Direction = ParameterDirection.Input;
                dbParam_PenaltyId6.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId6);

                SqlParameter dbParam_PenaltyId7 = new SqlParameter();
                dbParam_PenaltyId7.ParameterName = "@Penalty7Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId7.Value = this.Penalty7DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId7.Value = "0";
                dbParam_PenaltyId7.DbType = DbType.Decimal;
                dbParam_PenaltyId7.Direction = ParameterDirection.Input;
                dbParam_PenaltyId7.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId7);

                SqlParameter dbParam_PenaltyId8 = new SqlParameter();
                dbParam_PenaltyId8.ParameterName = "@Penalty8Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId8.Value = this.Penalty8DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId8.Value = "0";
                dbParam_PenaltyId8.DbType = DbType.Decimal;
                dbParam_PenaltyId8.Direction = ParameterDirection.Input;
                dbParam_PenaltyId8.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId8);

                SqlParameter dbParam_PenaltyId9 = new SqlParameter();
                dbParam_PenaltyId9.ParameterName = "@Penalty9Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId9.Value = this.Penalty9DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId9.Value = "0";
                dbParam_PenaltyId9.DbType = DbType.Decimal;
                dbParam_PenaltyId9.Direction = ParameterDirection.Input;
                dbParam_PenaltyId9.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId9);

                SqlParameter dbParam_PenaltyId10 = new SqlParameter();
                dbParam_PenaltyId10.ParameterName = "@Penalty10Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId10.Value = this.Penalty10DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId10.Value = "0";
                dbParam_PenaltyId10.DbType = DbType.Decimal;
                dbParam_PenaltyId10.Direction = ParameterDirection.Input;
                dbParam_PenaltyId10.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId10);

                SqlParameter dbParam_PenaltyId11 = new SqlParameter();
                dbParam_PenaltyId11.ParameterName = "@Penalty11Taker";
                if (PenaltyTakersPanel.Visible)
                    dbParam_PenaltyId11.Value = this.Penalty11DropDownList.SelectedValue;
                else
                    dbParam_PenaltyId11.Value = "0";
                dbParam_PenaltyId11.DbType = DbType.Decimal;
                dbParam_PenaltyId11.Direction = ParameterDirection.Input;
                dbParam_PenaltyId11.Size = 12;
                dbCommand.Parameters.Add(dbParam_PenaltyId11);


                SqlParameter dbParam_PositionId1 = new SqlParameter();
                dbParam_PositionId1.ParameterName = "@PositionPlayer1";
                dbParam_PositionId1.Value = PositionPlayer1.Value;
                dbParam_PositionId1.DbType = DbType.Decimal;
                dbParam_PositionId1.Direction = ParameterDirection.Input;
                dbParam_PositionId1.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId1);

                SqlParameter dbParam_PositionId2 = new SqlParameter();
                dbParam_PositionId2.ParameterName = "@PositionPlayer2";
                dbParam_PositionId2.Value = PositionPlayer2.Value;
                dbParam_PositionId2.DbType = DbType.Decimal;
                dbParam_PositionId2.Direction = ParameterDirection.Input;
                dbParam_PositionId2.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId2);

                SqlParameter dbParam_PositionId3 = new SqlParameter();
                dbParam_PositionId3.ParameterName = "@PositionPlayer3";
                dbParam_PositionId3.Value = PositionPlayer3.Value;
                dbParam_PositionId3.DbType = DbType.Decimal;
                dbParam_PositionId3.Direction = ParameterDirection.Input;
                dbParam_PositionId3.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId3);

                SqlParameter dbParam_PositionId4 = new SqlParameter();
                dbParam_PositionId4.ParameterName = "@PositionPlayer4";
                dbParam_PositionId4.Value = PositionPlayer4.Value;
                dbParam_PositionId4.DbType = DbType.Decimal;
                dbParam_PositionId4.Direction = ParameterDirection.Input;
                dbParam_PositionId4.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId4);

                SqlParameter dbParam_PositionId5 = new SqlParameter();
                dbParam_PositionId5.ParameterName = "@PositionPlayer5";
                dbParam_PositionId5.Value = PositionPlayer5.Value;
                dbParam_PositionId5.DbType = DbType.Decimal;
                dbParam_PositionId5.Direction = ParameterDirection.Input;
                dbParam_PositionId5.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId5);

                SqlParameter dbParam_PositionId6 = new SqlParameter();
                dbParam_PositionId6.ParameterName = "@PositionPlayer6";
                dbParam_PositionId6.Value = PositionPlayer6.Value;
                dbParam_PositionId6.DbType = DbType.Decimal;
                dbParam_PositionId6.Direction = ParameterDirection.Input;
                dbParam_PositionId6.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId6);

                SqlParameter dbParam_PositionId7 = new SqlParameter();
                dbParam_PositionId7.ParameterName = "@PositionPlayer7";
                dbParam_PositionId7.Value = PositionPlayer7.Value;
                dbParam_PositionId7.DbType = DbType.Decimal;
                dbParam_PositionId7.Direction = ParameterDirection.Input;
                dbParam_PositionId7.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId7);

                SqlParameter dbParam_PositionId8 = new SqlParameter();
                dbParam_PositionId8.ParameterName = "@PositionPlayer8";
                dbParam_PositionId8.Value = PositionPlayer8.Value;
                dbParam_PositionId8.DbType = DbType.Decimal;
                dbParam_PositionId8.Direction = ParameterDirection.Input;
                dbParam_PositionId8.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId8);

                SqlParameter dbParam_PositionId9 = new SqlParameter();
                dbParam_PositionId9.ParameterName = "@PositionPlayer9";
                dbParam_PositionId9.Value = PositionPlayer9.Value;
                dbParam_PositionId9.DbType = DbType.Decimal;
                dbParam_PositionId9.Direction = ParameterDirection.Input;
                dbParam_PositionId9.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId9);

                SqlParameter dbParam_PositionId10 = new SqlParameter();
                dbParam_PositionId10.ParameterName = "@PositionPlayer10";
                dbParam_PositionId10.Value = PositionPlayer10.Value;
                dbParam_PositionId10.DbType = DbType.Decimal;
                dbParam_PositionId10.Direction = ParameterDirection.Input;
                dbParam_PositionId10.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId10);

                SqlParameter dbParam_PositionId11 = new SqlParameter();
                dbParam_PositionId11.ParameterName = "@PositionPlayer11";
                dbParam_PositionId11.Value = PositionPlayer11.Value;
                dbParam_PositionId11.DbType = DbType.Decimal;
                dbParam_PositionId11.Direction = ParameterDirection.Input;
                dbParam_PositionId11.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId11);

                SqlParameter dbParam_PositionId12 = new SqlParameter();
                dbParam_PositionId12.ParameterName = "@PositionPlayer12";
                dbParam_PositionId12.Value = this.Position12DropDownList.SelectedValue;
                dbParam_PositionId12.DbType = DbType.Decimal;
                dbParam_PositionId12.Direction = ParameterDirection.Input;
                dbParam_PositionId12.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId12);

                SqlParameter dbParam_PositionId13 = new SqlParameter();
                dbParam_PositionId13.ParameterName = "@PositionPlayer13";
                dbParam_PositionId13.Value = this.Position13DropDownList.SelectedValue;
                dbParam_PositionId13.DbType = DbType.Decimal;
                dbParam_PositionId13.Direction = ParameterDirection.Input;
                dbParam_PositionId13.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId13);

                SqlParameter dbParam_PositionId14 = new SqlParameter();
                dbParam_PositionId14.ParameterName = "@PositionPlayer14";
                dbParam_PositionId14.Value = this.Position14DropDownList.SelectedValue;
                dbParam_PositionId14.DbType = DbType.Decimal;
                dbParam_PositionId14.Direction = ParameterDirection.Input;
                dbParam_PositionId14.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId14);

                SqlParameter dbParam_PositionId15 = new SqlParameter();
                dbParam_PositionId15.ParameterName = "@PositionPlayer15";
                dbParam_PositionId15.Value = this.Position15DropDownList.SelectedValue;
                dbParam_PositionId15.DbType = DbType.Decimal;
                dbParam_PositionId15.Direction = ParameterDirection.Input;
                dbParam_PositionId15.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId15);

                SqlParameter dbParam_PositionId16 = new SqlParameter();
                dbParam_PositionId16.ParameterName = "@PositionPlayer16";
                dbParam_PositionId16.Value = this.Position16DropDownList.SelectedValue;
                dbParam_PositionId16.DbType = DbType.Decimal;
                dbParam_PositionId16.Direction = ParameterDirection.Input;
                dbParam_PositionId16.Size = 2;
                dbCommand.Parameters.Add(dbParam_PositionId16);

                SqlParameter dbParam_InstructionId1 = new SqlParameter();
                dbParam_InstructionId1.ParameterName = "@InstructionPlayer1";
                dbParam_InstructionId1.Value = this.Instruction1DropDownList.SelectedValue;
                dbParam_InstructionId1.DbType = DbType.Decimal;
                dbParam_InstructionId1.Direction = ParameterDirection.Input;
                dbParam_InstructionId1.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId1);

                SqlParameter dbParam_InstructionId2 = new SqlParameter();
                dbParam_InstructionId2.ParameterName = "@InstructionPlayer2";
                dbParam_InstructionId2.Value = this.Instruction2DropDownList.SelectedValue;
                dbParam_InstructionId2.DbType = DbType.Decimal;
                dbParam_InstructionId2.Direction = ParameterDirection.Input;
                dbParam_InstructionId2.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId2);

                SqlParameter dbParam_InstructionId3 = new SqlParameter();
                dbParam_InstructionId3.ParameterName = "@InstructionPlayer3";
                dbParam_InstructionId3.Value = this.Instruction3DropDownList.SelectedValue;
                dbParam_InstructionId3.DbType = DbType.Decimal;
                dbParam_InstructionId3.Direction = ParameterDirection.Input;
                dbParam_InstructionId3.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId3);

                SqlParameter dbParam_InstructionId4 = new SqlParameter();
                dbParam_InstructionId4.ParameterName = "@InstructionPlayer4";
                dbParam_InstructionId4.Value = this.Instruction4DropDownList.SelectedValue;
                dbParam_InstructionId4.DbType = DbType.Decimal;
                dbParam_InstructionId4.Direction = ParameterDirection.Input;
                dbParam_InstructionId4.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId4);

                SqlParameter dbParam_InstructionId5 = new SqlParameter();
                dbParam_InstructionId5.ParameterName = "@InstructionPlayer5";
                dbParam_InstructionId5.Value = this.Instruction5DropDownList.SelectedValue;
                dbParam_InstructionId5.DbType = DbType.Decimal;
                dbParam_InstructionId5.Direction = ParameterDirection.Input;
                dbParam_InstructionId5.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId5);

                SqlParameter dbParam_InstructionId6 = new SqlParameter();
                dbParam_InstructionId6.ParameterName = "@InstructionPlayer6";
                dbParam_InstructionId6.Value = this.Instruction6DropDownList.SelectedValue;
                dbParam_InstructionId6.DbType = DbType.Decimal;
                dbParam_InstructionId6.Direction = ParameterDirection.Input;
                dbParam_InstructionId6.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId6);

                SqlParameter dbParam_InstructionId7 = new SqlParameter();
                dbParam_InstructionId7.ParameterName = "@InstructionPlayer7";
                dbParam_InstructionId7.Value = this.Instruction7DropDownList.SelectedValue;
                dbParam_InstructionId7.DbType = DbType.Decimal;
                dbParam_InstructionId7.Direction = ParameterDirection.Input;
                dbParam_InstructionId7.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId7);

                SqlParameter dbParam_InstructionId8 = new SqlParameter();
                dbParam_InstructionId8.ParameterName = "@InstructionPlayer8";
                dbParam_InstructionId8.Value = this.Instruction8DropDownList.SelectedValue;
                dbParam_InstructionId8.DbType = DbType.Decimal;
                dbParam_InstructionId8.Direction = ParameterDirection.Input;
                dbParam_InstructionId8.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId8);

                SqlParameter dbParam_InstructionId9 = new SqlParameter();
                dbParam_InstructionId9.ParameterName = "@InstructionPlayer9";
                dbParam_InstructionId9.Value = this.Instruction9DropDownList.SelectedValue;
                dbParam_InstructionId9.DbType = DbType.Decimal;
                dbParam_InstructionId9.Direction = ParameterDirection.Input;
                dbParam_InstructionId9.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId9);

                SqlParameter dbParam_InstructionId10 = new SqlParameter();
                dbParam_InstructionId10.ParameterName = "@InstructionPlayer10";
                dbParam_InstructionId10.Value = this.Instruction10DropDownList.SelectedValue;
                dbParam_InstructionId10.DbType = DbType.Decimal;
                dbParam_InstructionId10.Direction = ParameterDirection.Input;
                dbParam_InstructionId10.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId10);

                SqlParameter dbParam_InstructionId11 = new SqlParameter();
                dbParam_InstructionId11.ParameterName = "@InstructionPlayer11";
                dbParam_InstructionId11.Value = this.Instruction11DropDownList.SelectedValue;
                dbParam_InstructionId11.DbType = DbType.Decimal;
                dbParam_InstructionId11.Direction = ParameterDirection.Input;
                dbParam_InstructionId11.Size = 2;
                dbCommand.Parameters.Add(dbParam_InstructionId11);

                SqlParameter dbParam_AggressivenessId1 = new SqlParameter();
                dbParam_AggressivenessId1.ParameterName = "@AggressivenessPlayer1";
                dbParam_AggressivenessId1.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId1.DbType = DbType.Decimal;
                dbParam_AggressivenessId1.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId1.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId1);

                SqlParameter dbParam_AggressivenessId2 = new SqlParameter();
                dbParam_AggressivenessId2.ParameterName = "@AggressivenessPlayer2";
                dbParam_AggressivenessId2.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId2.DbType = DbType.Decimal;
                dbParam_AggressivenessId2.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId2.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId2);

                SqlParameter dbParam_AggressivenessId3 = new SqlParameter();
                dbParam_AggressivenessId3.ParameterName = "@AggressivenessPlayer3";
                dbParam_AggressivenessId3.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId3.DbType = DbType.Decimal;
                dbParam_AggressivenessId3.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId3.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId3);

                SqlParameter dbParam_AggressivenessId4 = new SqlParameter();
                dbParam_AggressivenessId4.ParameterName = "@AggressivenessPlayer4";
                dbParam_AggressivenessId4.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId4.DbType = DbType.Decimal;
                dbParam_AggressivenessId4.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId4.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId4);

                SqlParameter dbParam_AggressivenessId5 = new SqlParameter();
                dbParam_AggressivenessId5.ParameterName = "@AggressivenessPlayer5";
                dbParam_AggressivenessId5.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId5.DbType = DbType.Decimal;
                dbParam_AggressivenessId5.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId5.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId5);

                SqlParameter dbParam_AggressivenessId6 = new SqlParameter();
                dbParam_AggressivenessId6.ParameterName = "@AggressivenessPlayer6";
                dbParam_AggressivenessId6.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId6.DbType = DbType.Decimal;
                dbParam_AggressivenessId6.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId6.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId6);

                SqlParameter dbParam_AggressivenessId7 = new SqlParameter();
                dbParam_AggressivenessId7.ParameterName = "@AggressivenessPlayer7";
                dbParam_AggressivenessId7.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId7.DbType = DbType.Decimal;
                dbParam_AggressivenessId7.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId7.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId7);

                SqlParameter dbParam_AggressivenessId8 = new SqlParameter();
                dbParam_AggressivenessId8.ParameterName = "@AggressivenessPlayer8";
                dbParam_AggressivenessId8.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId8.DbType = DbType.Decimal;
                dbParam_AggressivenessId8.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId8.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId8);

                SqlParameter dbParam_AggressivenessId9 = new SqlParameter();
                dbParam_AggressivenessId9.ParameterName = "@AggressivenessPlayer9";
                dbParam_AggressivenessId9.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId9.DbType = DbType.Decimal;
                dbParam_AggressivenessId9.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId9.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId9);

                SqlParameter dbParam_AggressivenessId10 = new SqlParameter();
                dbParam_AggressivenessId10.ParameterName = "@AggressivenessPlayer10";
                dbParam_AggressivenessId10.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId10.DbType = DbType.Decimal;
                dbParam_AggressivenessId10.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId10.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId10);

                SqlParameter dbParam_AggressivenessId11 = new SqlParameter();
                dbParam_AggressivenessId11.ParameterName = "@AggressivenessPlayer11";
                dbParam_AggressivenessId11.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId11.DbType = DbType.Decimal;
                dbParam_AggressivenessId11.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId11.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId11);

                SqlParameter dbParam_AggressivenessId12 = new SqlParameter();
                dbParam_AggressivenessId12.ParameterName = "@AggressivenessPlayer12";
                dbParam_AggressivenessId12.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId12.DbType = DbType.Decimal;
                dbParam_AggressivenessId12.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId12.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId12);

                SqlParameter dbParam_AggressivenessId13 = new SqlParameter();
                dbParam_AggressivenessId13.ParameterName = "@AggressivenessPlayer13";
                dbParam_AggressivenessId13.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId13.DbType = DbType.Decimal;
                dbParam_AggressivenessId13.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId13.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId13);

                SqlParameter dbParam_AggressivenessId14 = new SqlParameter();
                dbParam_AggressivenessId14.ParameterName = "@AggressivenessPlayer14";
                dbParam_AggressivenessId14.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId14.DbType = DbType.Decimal;
                dbParam_AggressivenessId14.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId14.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId14);

                SqlParameter dbParam_AggressivenessId15 = new SqlParameter();
                dbParam_AggressivenessId15.ParameterName = "@AggressivenessPlayer15";
                dbParam_AggressivenessId15.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId15.DbType = DbType.Decimal;
                dbParam_AggressivenessId15.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId15.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId15);

                SqlParameter dbParam_AggressivenessId16 = new SqlParameter();
                dbParam_AggressivenessId16.ParameterName = "@AggressivenessPlayer16";
                dbParam_AggressivenessId16.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_AggressivenessId16.DbType = DbType.Decimal;
                dbParam_AggressivenessId16.Direction = ParameterDirection.Input;
                dbParam_AggressivenessId16.Size = 2;
                dbCommand.Parameters.Add(dbParam_AggressivenessId16);

                SqlParameter dbParam_AttitudeId1 = new SqlParameter();
                dbParam_AttitudeId1.ParameterName = "@Attitudeplayer1";
                dbParam_AttitudeId1.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId1.DbType = DbType.Decimal;
                dbParam_AttitudeId1.Direction = ParameterDirection.Input;
                dbParam_AttitudeId1.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId1);

                SqlParameter dbParam_AttitudeId2 = new SqlParameter();
                dbParam_AttitudeId2.ParameterName = "@Attitudeplayer2";
                dbParam_AttitudeId2.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId2.DbType = DbType.Decimal;
                dbParam_AttitudeId2.Direction = ParameterDirection.Input;
                dbParam_AttitudeId2.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId2);

                SqlParameter dbParam_AttitudeId3 = new SqlParameter();
                dbParam_AttitudeId3.ParameterName = "@Attitudeplayer3";
                dbParam_AttitudeId3.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId3.DbType = DbType.Decimal;
                dbParam_AttitudeId3.Direction = ParameterDirection.Input;
                dbParam_AttitudeId3.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId3);

                SqlParameter dbParam_AttitudeId4 = new SqlParameter();
                dbParam_AttitudeId4.ParameterName = "@Attitudeplayer4";
                dbParam_AttitudeId4.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId4.DbType = DbType.Decimal;
                dbParam_AttitudeId4.Direction = ParameterDirection.Input;
                dbParam_AttitudeId4.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId4);

                SqlParameter dbParam_AttitudeId5 = new SqlParameter();
                dbParam_AttitudeId5.ParameterName = "@Attitudeplayer5";
                dbParam_AttitudeId5.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId5.DbType = DbType.Decimal;
                dbParam_AttitudeId5.Direction = ParameterDirection.Input;
                dbParam_AttitudeId5.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId5);

                SqlParameter dbParam_AttitudeId6 = new SqlParameter();
                dbParam_AttitudeId6.ParameterName = "@Attitudeplayer6";
                dbParam_AttitudeId6.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId6.DbType = DbType.Decimal;
                dbParam_AttitudeId6.Direction = ParameterDirection.Input;
                dbParam_AttitudeId6.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId6);

                SqlParameter dbParam_AttitudeId7 = new SqlParameter();
                dbParam_AttitudeId7.ParameterName = "@Attitudeplayer7";
                dbParam_AttitudeId7.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId7.DbType = DbType.Decimal;
                dbParam_AttitudeId7.Direction = ParameterDirection.Input;
                dbParam_AttitudeId7.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId7);

                SqlParameter dbParam_AttitudeId8 = new SqlParameter();
                dbParam_AttitudeId8.ParameterName = "@Attitudeplayer8";
                dbParam_AttitudeId8.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId8.DbType = DbType.Decimal;
                dbParam_AttitudeId8.Direction = ParameterDirection.Input;
                dbParam_AttitudeId8.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId8);

                SqlParameter dbParam_AttitudeId9 = new SqlParameter();
                dbParam_AttitudeId9.ParameterName = "@Attitudeplayer9";
                dbParam_AttitudeId9.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId9.DbType = DbType.Decimal;
                dbParam_AttitudeId9.Direction = ParameterDirection.Input;
                dbParam_AttitudeId9.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId9);

                SqlParameter dbParam_AttitudeId10 = new SqlParameter();
                dbParam_AttitudeId10.ParameterName = "@Attitudeplayer10";
                dbParam_AttitudeId10.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId10.DbType = DbType.Decimal;
                dbParam_AttitudeId10.Direction = ParameterDirection.Input;
                dbParam_AttitudeId10.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId10);

                SqlParameter dbParam_AttitudeId11 = new SqlParameter();
                dbParam_AttitudeId11.ParameterName = "@Attitudeplayer11";
                dbParam_AttitudeId11.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId11.DbType = DbType.Decimal;
                dbParam_AttitudeId11.Direction = ParameterDirection.Input;
                dbParam_AttitudeId11.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId11);

                SqlParameter dbParam_AttitudeId12 = new SqlParameter();
                dbParam_AttitudeId12.ParameterName = "@Attitudeplayer12";
                dbParam_AttitudeId12.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId12.DbType = DbType.Decimal;
                dbParam_AttitudeId12.Direction = ParameterDirection.Input;
                dbParam_AttitudeId12.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId12);

                SqlParameter dbParam_AttitudeId13 = new SqlParameter();
                dbParam_AttitudeId13.ParameterName = "@Attitudeplayer13";
                dbParam_AttitudeId13.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId13.DbType = DbType.Decimal;
                dbParam_AttitudeId13.Direction = ParameterDirection.Input;
                dbParam_AttitudeId13.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId13);

                SqlParameter dbParam_AttitudeId14 = new SqlParameter();
                dbParam_AttitudeId14.ParameterName = "@Attitudeplayer14";
                dbParam_AttitudeId14.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId14.DbType = DbType.Decimal;
                dbParam_AttitudeId14.Direction = ParameterDirection.Input;
                dbParam_AttitudeId14.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId14);

                SqlParameter dbParam_AttitudeId15 = new SqlParameter();
                dbParam_AttitudeId15.ParameterName = "@Attitudeplayer15";
                dbParam_AttitudeId15.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId15.DbType = DbType.Decimal;
                dbParam_AttitudeId15.Direction = ParameterDirection.Input;
                dbParam_AttitudeId15.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId15);

                SqlParameter dbParam_AttitudeId16 = new SqlParameter();
                dbParam_AttitudeId16.ParameterName = "@Attitudeplayer16";
                dbParam_AttitudeId16.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_AttitudeId16.DbType = DbType.Decimal;
                dbParam_AttitudeId16.Direction = ParameterDirection.Input;
                dbParam_AttitudeId16.Size = 2;
                dbCommand.Parameters.Add(dbParam_AttitudeId16);

                SqlParameter dbParam_PreferredActionId1 = new SqlParameter();
                dbParam_PreferredActionId1.ParameterName = "@PreferredActionplayer1";
                dbParam_PreferredActionId1.Value = this.PreferredAction1DropDownList.SelectedValue;
                dbParam_PreferredActionId1.DbType = DbType.Decimal;
                dbParam_PreferredActionId1.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId1.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId1);

                SqlParameter dbParam_PreferredActionId2 = new SqlParameter();
                dbParam_PreferredActionId2.ParameterName = "@PreferredActionplayer2";
                dbParam_PreferredActionId2.Value = this.PreferredAction2DropDownList.SelectedValue;
                dbParam_PreferredActionId2.DbType = DbType.Decimal;
                dbParam_PreferredActionId2.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId2.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId2);

                SqlParameter dbParam_PreferredActionId3 = new SqlParameter();
                dbParam_PreferredActionId3.ParameterName = "@PreferredActionplayer3";
                dbParam_PreferredActionId3.Value = this.PreferredAction3DropDownList.SelectedValue;
                dbParam_PreferredActionId3.DbType = DbType.Decimal;
                dbParam_PreferredActionId3.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId3.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId3);

                SqlParameter dbParam_PreferredActionId4 = new SqlParameter();
                dbParam_PreferredActionId4.ParameterName = "@PreferredActionplayer4";
                dbParam_PreferredActionId4.Value = this.PreferredAction4DropDownList.SelectedValue;
                dbParam_PreferredActionId4.DbType = DbType.Decimal;
                dbParam_PreferredActionId4.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId4.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId4);

                SqlParameter dbParam_PreferredActionId5 = new SqlParameter();
                dbParam_PreferredActionId5.ParameterName = "@PreferredActionplayer5";
                dbParam_PreferredActionId5.Value = this.PreferredAction5DropDownList.SelectedValue;
                dbParam_PreferredActionId5.DbType = DbType.Decimal;
                dbParam_PreferredActionId5.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId5.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId5);

                SqlParameter dbParam_PreferredActionId6 = new SqlParameter();
                dbParam_PreferredActionId6.ParameterName = "@PreferredActionplayer6";
                dbParam_PreferredActionId6.Value = this.PreferredAction6DropDownList.SelectedValue;
                dbParam_PreferredActionId6.DbType = DbType.Decimal;
                dbParam_PreferredActionId6.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId6.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId6);

                SqlParameter dbParam_PreferredActionId7 = new SqlParameter();
                dbParam_PreferredActionId7.ParameterName = "@PreferredActionplayer7";
                dbParam_PreferredActionId7.Value = this.PreferredAction7DropDownList.SelectedValue;
                dbParam_PreferredActionId7.DbType = DbType.Decimal;
                dbParam_PreferredActionId7.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId7.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId7);

                SqlParameter dbParam_PreferredActionId8 = new SqlParameter();
                dbParam_PreferredActionId8.ParameterName = "@PreferredActionplayer8";
                dbParam_PreferredActionId8.Value = this.PreferredAction8DropDownList.SelectedValue;
                dbParam_PreferredActionId8.DbType = DbType.Decimal;
                dbParam_PreferredActionId8.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId8.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId8);

                SqlParameter dbParam_PreferredActionId9 = new SqlParameter();
                dbParam_PreferredActionId9.ParameterName = "@PreferredActionplayer9";
                dbParam_PreferredActionId9.Value = this.PreferredAction9DropDownList.SelectedValue;
                dbParam_PreferredActionId9.DbType = DbType.Decimal;
                dbParam_PreferredActionId9.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId9.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId9);

                SqlParameter dbParam_PreferredActionId10 = new SqlParameter();
                dbParam_PreferredActionId10.ParameterName = "@PreferredActionplayer10";
                dbParam_PreferredActionId10.Value = this.PreferredAction10DropDownList.SelectedValue;
                dbParam_PreferredActionId10.DbType = DbType.Decimal;
                dbParam_PreferredActionId10.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId10.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId10);

                SqlParameter dbParam_PreferredActionId11 = new SqlParameter();
                dbParam_PreferredActionId11.ParameterName = "@PreferredActionplayer11";
                dbParam_PreferredActionId11.Value = this.PreferredAction11DropDownList.SelectedValue;
                dbParam_PreferredActionId11.DbType = DbType.Decimal;
                dbParam_PreferredActionId11.Direction = ParameterDirection.Input;
                dbParam_PreferredActionId11.Size = 2;
                dbCommand.Parameters.Add(dbParam_PreferredActionId11);

                SqlParameter dbParam_TeamAggressiveness = new SqlParameter();
                dbParam_TeamAggressiveness.ParameterName = "@TeamAggressiveness";
                dbParam_TeamAggressiveness.Value = this.TeamAggressivenessDropDownList.SelectedValue;
                dbParam_TeamAggressiveness.DbType = DbType.Decimal;
                dbParam_TeamAggressiveness.Direction = ParameterDirection.Input;
                dbParam_TeamAggressiveness.Size = 2;
                dbCommand.Parameters.Add(dbParam_TeamAggressiveness);


                SqlParameter dbParam_TeamAttitude = new SqlParameter();
                dbParam_TeamAttitude.ParameterName = "@TeamAttitude";
                dbParam_TeamAttitude.Value = this.TeamAttitudeDropDownList.SelectedValue;
                dbParam_TeamAttitude.DbType = DbType.Decimal;
                dbParam_TeamAttitude.Direction = ParameterDirection.Input;
                dbParam_TeamAttitude.Size = 2;
                dbCommand.Parameters.Add(dbParam_TeamAttitude);


                SqlParameter dbParam_Captain = new SqlParameter();
                dbParam_Captain.ParameterName = "@Captain";
                dbParam_Captain.Value = this.CaptainDropDownList.SelectedValue;
                dbParam_Captain.DbType = DbType.Decimal;
                dbParam_Captain.Direction = ParameterDirection.Input;
                dbParam_Captain.Size = 12;
                dbCommand.Parameters.Add(dbParam_Captain);


                SqlParameter dbParam_SetPiecesTaker = new SqlParameter();
                dbParam_SetPiecesTaker.ParameterName = "@SetPiecesTaker";
                dbParam_SetPiecesTaker.Value = this.PiecesTakerDropDownList.SelectedValue;
                dbParam_SetPiecesTaker.DbType = DbType.Decimal;
                dbParam_SetPiecesTaker.Direction = ParameterDirection.Input;
                dbParam_SetPiecesTaker.Size = 12;
                dbCommand.Parameters.Add(dbParam_SetPiecesTaker);

                SqlParameter dbParam_Answer = new SqlParameter();
                dbParam_Answer.ParameterName = "@Answer";
                dbParam_Answer.Value = "";
                dbParam_Answer.DbType = DbType.String;
                dbParam_Answer.Direction = ParameterDirection.Output;
                dbParam_Answer.Size = 64;
                dbCommand.Parameters.Add(dbParam_Answer);

                SqlParameter dbParam_Status = new SqlParameter();
                dbParam_Status.ParameterName = "@Status";
                dbParam_Status.Value = "";
                dbParam_Status.DbType = DbType.Int16;
                dbParam_Status.Direction = ParameterDirection.Output;
                dbCommand.Parameters.Add(dbParam_Status);

                SqlParameter dbParam_Language = new SqlParameter();
                dbParam_Language.ParameterName = "@Language";
                dbParam_Language.Value = GND.GetUserLanguage();
                dbParam_Language.DbType = DbType.Decimal;
                dbParam_Language.Direction = ParameterDirection.Input;
                dbParam_Language.Size = 3;
                dbCommand.Parameters.Add(dbParam_Language);


                try
                {
                    dbConnection.Open();
                    dbCommand.ExecuteScalar();
                    if (dbParam_Status.Value.ToString() == "0")
                        Response.Redirect("ListOfTeamMatches.aspx?ConfirmNote=" + dbParam_Answer.Value.ToString());
                    else
                    {
                        this.PlayersToSubmitErrorLabel.ForeColor = System.Drawing.Color.Green;
                        this.PlayersToSubmitErrorLabel.Text = dbParam_Answer.Value.ToString();
                        //this.PlayersToSubmitErrorLabel.Text = dbParam_Status.Value.ToString();
                    }
                }
                catch (Exception SQLDBException)
                {
                    this.Message.ForeColor = System.Drawing.Color.Red;
                    this.Message.Text = Convert.ToString(SQLDBException);
                }

                finally
                {
                    dbConnection.Close();
                }

            }



        }
        //protected void PlayerDetailsLinkButtonClick(object sender, EventArgs e)
        //{
        //    if (this.ShowPlayerDetailsLinkButton.Text == Resources.Resource.MatchInstructionsStep2_ShowPlayerDetailsLinkButton)
        //    {
        //        this.PlayerDetailsPanel.Visible = true;
        //        this.ShowPlayerDetailsLinkButton.Text = Resources.Resource.Global_HidePlayersDetails;
        //    }
        //    else
        //    {
        //        this.PlayerDetailsPanel.Visible = false;
        //        this.ShowPlayerDetailsLinkButton.Text = Resources.Resource.MatchInstructionsStep2_ShowPlayerDetailsLinkButton;
        //    }
        //}

        private void SwitchAscDescHiddenFieldValues()
        {
            if (this.SortAscDescHiddenField.Value == "ASC")
                this.SortAscDescHiddenField.Value = "DESC";
            else
                this.SortAscDescHiddenField.Value = "ASC";
        }

        protected void SortByPlayer(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Player")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Player");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Player";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Player");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }

        protected void SortByFitness(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Fitness")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Fitness");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Fitness";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Fitness");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }

        protected void SortByCharisma(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Charisma")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Charisma");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Charisma";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Charisma");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByExperience(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Experience")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Experience");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Experience";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Experience");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByStrongFoot(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "StrongFoot")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "StrongFoot");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "StrongFoot";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "StrongFoot");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByInstincts(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Instincts")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Instincts");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Instincts";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Instincts");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByGoalKeeping(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "GoalKeeping")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "GoalKeeping");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "GoalKeeping";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "GoalKeeping");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }

        protected void SortByPositioning(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Positioning")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Positioning");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Positioning";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Positioning");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByStamina(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Stamina")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Stamina");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Stamina";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Stamina");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByPower(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Power")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Power");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Power";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Power");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByTackling(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Tackling")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Tackling");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Tackling";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Tackling");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByHeading(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Heading")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Heading");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Heading";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Heading");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByQuickness(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Quickness")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Quickness");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Quickness";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Quickness");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByTechnique(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Technique")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Technique");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Technique";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Technique");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByShortPassing(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "ShortPassing")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "ShortPassing");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "ShortPassing";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "ShortPassing");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByLongPassing(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "LongPassing")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "LongPassing");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "LongPassing";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "LongPassing");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByShooting(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Shooting")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Shooting");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Shooting";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Shooting");
                this.SortAscDescHiddenField.Value = "DESC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "DESC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByAge(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "Age")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Age");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "Age";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "Age");
                this.SortAscDescHiddenField.Value = "ASC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "ASC");
            }
            this.PlayersGridView.DataBind();
        }
        protected void SortByShirtNumber(Object sender, EventArgs e)
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Clear();
            this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("TeamId", ou.TeamId);
            if (this.SortByHiddenField.Value == "ShirtNum")
            {
                SwitchAscDescHiddenFieldValues();
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "ShirtNum");
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", this.SortAscDescHiddenField.Value);
            }
            else
            {
                this.SortByHiddenField.Value = "ShirtNum";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderBy", "ShirtNum");
                this.SortAscDescHiddenField.Value = "ASC";
                this.TeamListOfPlayersSqlDataSource.SelectParameters.Add("OrderASC", "ASC");
            }
            this.PlayersGridView.DataBind();
        }

        protected override void InitializeCulture()
        {
            OnlineUser ou = (OnlineUser)Session["User"];
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(ou.UICulture);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(ou.Culture);
        }

        protected string InjuryIconName(object Injury)
        {
            GetNivdalData.GetNivdalData GND = new GetNivdalData.GetNivdalData();
            return GND.InjuryIconName(Injury);
        }
    }
}